Skip to content

Instantly share code, notes, and snippets.

@vishakvkt
Last active February 22, 2016 23:36
Show Gist options
  • Save vishakvkt/8b4ceeaa37dbdfef7430 to your computer and use it in GitHub Desktop.
Save vishakvkt/8b4ceeaa37dbdfef7430 to your computer and use it in GitHub Desktop.
Read file line by line
var fs = require('fs');
var readline = require('readline');
var reader = readline.createInterface({
input: fs.createReadStream('data.txt')
});
reader.on('line', (line) => {
console.log(line);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment