-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.readlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.
Description
An issue to not forget.
It would be handy to sync readline API with for-await
support in readable streams, so we can do something like this (compare examples here and here):
'use strict';
const readline = require('readline');
const fs = require('fs');
async function processLineByLine(filePath) {
const rli = readline.createInterface({
input: fs.createReadStream(filePath),
crlfDelay: Infinity
});
for await (const line of rli) {
console.log(line);
}
}
processLineByLine('config.ini').catch(console.error);
An evidence of need: "Alas" from Axel Rauschmayer.
An association: Perl <FILEHANDLE>
operator.
devsnek, not-an-aardvark, prog1dev, benjamingr, ex1st and 16 more
Metadata
Metadata
Assignees
Labels
promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.readlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.