Last active
April 15, 2021 12:28
-
-
Save xinyii/7fa29846166d8512cea391c7c33ac150 to your computer and use it in GitHub Desktop.
[Read Line] #nodejs
This file contains 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
const fs = require('fs') | |
const readline = require('readline') | |
const fileStream = fs.createReadStream('input.txt') | |
const rl = readline.createInterface({ | |
input: fileStream, | |
crlfDelay: Infinity | |
}) | |
for await (const line of rl) { | |
console.log('line', line) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment