var csv = require("csv"), fs = require("fs"); // the job of the parser is to convert a CSV file // to a list of rows (array of rows) var parser = csv.parse({ columns: function(line) { // By defining this callback, we get handed the // first line of the spreadsheet. Which we'll // ignore and effectively skip this line from processing }, skip_empty_lines: true }); var ids = []; var transformer = csv.transform(function(data) { // this will get row by row data, so for example, // this will read the first column and store it var id = data[0]; if (id) { ids.push(id); } }); // called when done with processing the CSV transformer.on("finish", function() { console.log("done!"); }); // create a read stream of our CSV file var stream = fs.createReadStream("./my.csv"); // pipe the CSV file to the parser to convert to arrays, // then to the transformer to read row by row stream.pipe(parser).pipe(transformer);