خرید بک لینک

Vote count: 0

I have a Node app in a directory together with a text file called sample.csv.

I'm trying to read the file line-by-line with the following code, but nothing gets read:

var readline = require('readline');
var fs = require('fs');    

var lineReader = readline.createInterface({
   input: fs.createReadStream('sample.csv')
});

lineReader.on('line', function (line) {
    console.log(line); // Never happens
});

console.log('Completed.'); // Immediately skips to this

Any bright ideas? :) Thanks!

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 18 فروردين 1395 ساعت: 15:11

صفحه بندی