I am trying to first read the CSV file, but I am getting an error saying:
TypeError: fs.createReadStream is not a function.
Am I doing something wrong? Here is my code:
fs.createReadStream('accounts.csv')
.pipe(csv())
.on('data', function (data) {
console.log(data);
})
.on('end', function () {
console.log('Read finished');
});
const fs = require('fs')or somthing similar in your js file?fs.createReadStreamistn' a function it seems like you haven't imported it correctlycan't find <file>