We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I get the number of lines of the file with your library?
The text was updated successfully, but these errors were encountered:
Up ! Agree that would be super useful, because there is currently no way to known when the end of file has been reached
Sorry, something went wrong.
I found a way by wrapping into a promise and declare a global variable that you can increment. Code is bellow (ts).
let maxLines: number = 0 return new Promise((resolve, reject) => { rl.on('line', (line, lineCount, byteCount) => { maxLines = lineCount // here i am looking for a string, and... // ... if blahbla => resolve promise }) .on('end', () => { console.log('End of file reached', maxLines) }) .on('error', (err) => { reject(err) }) })
No branches or pull requests
How can I get the number of lines of the file with your library?
The text was updated successfully, but these errors were encountered: