cr

csv-read

Read CSV files using Node.js

Showing:

Popularity

Downloads/wk

28

GitHub Stars

1

Maintenance

Last Commit

2yrs ago

Contributors

0

Package

Dependencies

1

Size (min+gzip)

1.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

CSVRead

Read a CSV file using streams. Optimized for big files. Reads 1 Million lines in lesser then a second!

const CSVRead = require('csv-read')

const csv = CSVRead.load('./data/test.csv', {
  delimiter: ';'
})

csv.parse((line, index) => {
  console.log(line) // Line as an object, using keys from first line
}).then((res) => {
  // res contains the full parsed csv as an array
  console.log(`${res.length} lines parsed`)
})

Options

str delimiter

Set column delimiter, default: ,

str quote

Set column quote, default: "

str newline

Set new line char, default: \n

arr columns

Optional, set column keys, if this is not set, the first line is used as column keys

num columnOffset

Sets the column offset. Defaults to 0

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100