Created
December 21, 2019 01:34
-
-
Save mrm8488/c6084bd3226e9040802c3fbb0539e8ca to your computer and use it in GitHub Desktop.
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
// Node.js readline & async iteration: | |
const fs = require('fs"); | |
const {createlnterface: ci} = | |
require('readline’); | |
async function logLines(ls) { | |
for await (const l of ls) { | |
console.log('>"' + l); | |
} | |
} | |
const rl = ci({input: | |
fs.createReadStream('file.txt")}); | |
logLines(rl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment