parse-csv-stream
Parse csv files via stream or parse any csv stream from various sources in Node.js for different usecases like batch processing, database insertion, logging, file creation & data transformations etc. Support for large csv files added.
Example:
const parse_csv = require('parse-csv-stream');
const fs = require('fs');
const readStream = fs.createReadStream('./test.csv', 'utf8');
const writeStream = fs.createWriteStream('./test.json');
const options = {
};
const parser = new parse_csv(options);
const events = parser.events;
events.on('data', (row) => {
console.log(row);
})
readStream.on('data', (chunk) => {
let resultset = parser.parse(chunk);
});
readStream.pipe(parser).pipe(writeStream);
Built With
- Native Node.js modules
- No external dependencies.
Authors
License
[MIT License] © Ayush Pratap