I'm using the fast-csv node library to parse a csv-file named myFile.csv. The code looks like this:
var csv = require("fast-csv");
var fs = require("fs");
var stream = fs.createReadStream('myFile.csv');
csv
.fromStream(stream, {headers : true})
.on("data", function(data){
console.log("Start of parsing...");
console.log(data);
})
.on("end", function(data){
console.log(data);
console.log("End of parsing");
})
When I run it, I see the following two lines in node console:
1
End of parsing
It doesn't print "Start of parsing..." or any data from the csv file. What could be the reason for that? Thanks in advance!