Fast-csv is library for parsing and formatting csvs or any other delimited value file in node.
npm install -S fast-csv
parsing
To read a csv with headers create a read stream and pipe it to parser.
fs.createReadStream('path/to/my.csv')
.pipe(csv.parse({ headers: true }))
.on('data', row => console.log(row))
For more in depth parsing examples and docs check out the parsing docs
formatting
To format a csv you can write rows to a formatter.
someStream
.pipe(csv.format({ headers: true })
.pipe(process.stdout);
For more in depth formatting examples and docs check out the formatting docs
MIT https://github.com/C2FO/fast-csv/raw/master/LICENSE
- Code:
git clone git://github.com/C2FO/fast-csv.git
- Website: http://c2fo.com
- Twitter: http://twitter.com/c2fo - 877.465.4045