csv2json-stream
v0.1.2
Published
Streaming parser csv to json
Downloads
19
Readme
csv2json
csv file to json array - streaming
Optional Parameter: Pass an object
delim => delimiter used
\t for tab delimited file
, for comma delimited file, will take care of double quoted values as well.
var fs = require('fs');
var csv2json = require('./index.js');
var opts = {
// delim : '\t'
delim : ',',
columns: ['Column1', 'Column2', 'Column3']
};
fs.createReadStream('csv.csv').pipe(csv2json(opts)).pipe(fs.createWriteStream('csv.json'));
You can also run the basic test:
node /test