
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
csv streaming parser to JSON.
npm install csvstream
var csvstream = require('csvstream');
var fs = require('fs');
var rs = fs.createReadStream('./test/test1.csv');
var ws_head = fs.createWriteStream('./test/output2.json');
var csvs = new csvstream({header: true}, function(err, result) {
if(err)
console.error(err);
console.log(result);
// [
// { aaa: '1', bbb: '2', ccc: '3' },
// { aaa: '4', bbb: '5', ccc: '6' },
// { aaa: '7', bbb: '8', ccc: '9' }
// ])
});
rs.pipe(csvs).pipe(ws_head);
Options are optional.
utf8
,
\n
\"
false
Raw data
"aaa","bbb","ccc"
1, 2, 3
4, 5, 6
7, 8, 9
header
equals false you get:
[
["aaa","bb\"\"b","ccc"]
,["1","2","3"]
,["4","5","6"]
,["7","8","9"]
]
header
equals true you get:
[
{"aaa":"1","bbb":"2","ccc":"3"}
,{"aaa":"4","bbb":"5","ccc":"6"}
,{"aaa":"7","bbb":"8","ccc":"9"}
]
Lint your csv files https://github.com/chilijung/csvlint.js before parsing :)
var csvstream = require('../csvstream');
var csvlint = require('csvlint');
var fs = require('fs');
var rs = fs.createReadStream('./benchmark/100000.csv');
var ws = fs.createWriteStream('./benchmark/output2.json');
var csvlint = csvlint();
var csvs = csvstream({header: true});
csvlint.on('finish', function() {
console.log('csv lint is end');
})
csvs.on('finish', function() {
console.log('csv stream is end')
})
rs.pipe(csvlint).pipe(csvs).pipe(ws);
npm test
https://github.com/klaemo/csv-stream
MIT
FAQs
csv streaming parser
The npm package csvstream receives a total of 18 weekly downloads. As such, csvstream popularity was classified as not popular.
We found that csvstream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.