Created
June 23, 2020 14:56
-
-
Save rimiti/d9db7701926e218191cc8d6d3345ec3e to your computer and use it in GitHub Desktop.
Stream big csv file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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