Created
March 21, 2016 07:50
-
-
Save monkeym4ster/50e936b40fc579017956 to your computer and use it in GitHub Desktop.
Read File Stream Line-by-Line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
readline = require('readline') | |
fs = require('fs') | |
rl = readline.createInterface( | |
input: fs.createReadStream('sample.txt') | |
) | |
rl.on 'line', (line) -> | |
console.log 'Line from file:', line | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment