Skip to content

Instantly share code, notes, and snippets.

@rimiti
Created June 23, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rimiti/d9db7701926e218191cc8d6d3345ec3e to your computer and use it in GitHub Desktop.
Save rimiti/d9db7701926e218191cc8d6d3345ec3e to your computer and use it in GitHub Desktop.
Stream big csv file
const fs = require('fs');
const csv = require('csvtojson');
const csvStream = fs.createReadStream('./file.csv');
const converter = new csv.Converter({});
converter
.fromStream(csvStream)
.subscribe((row) => {
console.log(row)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment