You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While authoring a parser, I came across what you would normally get in organic search and found lots of it a little dangerous. Namely the use of big module APIs from npm don't occur to make the biggest sense here, since readline has a lot of good functionality built-in. Namely consuming file through readline's interface as steam.
In order to promote use of this, I'd suggest to add an example usage to the docs, which I derived from this stackoverflow link.
This case seemed really common to me, which is why I authored the below PR.
constreadline=require('readline');constfs=require('fs');constrl=readline.createInterface({input: fs.createReadStream('sample.txt')});rl.on('line',function(line){console.log('Line from file:',line);});
While authoring a parser, I came across what you would normally get in organic search and found lots of it a little dangerous. Namely the use of big module APIs from
npm
don't occur to make the biggest sense here, sincereadline
has a lot of good functionality built-in. Namely consuming file throughreadline
's interface as steam.In order to promote use of this, I'd suggest to add an example usage to the docs, which I derived from this stackoverflow link.
This case seemed really common to me, which is why I authored the below PR.
PR: #4609
The text was updated successfully, but these errors were encountered: