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
code:
const fs = require('fs/promises'); const readLastLines = require('read-last-lines'); async function main() { const testPath = '/Users/yutengjing/code/scripting-listener/package-lock.json'; const lines = await readLastLines.read(testPath, 3, 'utf8'); console.log(lines.split('\n').length); } main();
test txt file:
asaa bb
The text was updated successfully, but these errors were encountered:
I know this is caused by: https://github.com/alexbbt/read-last-lines/blob/master/src/index.js#L77
if (NEW_LINE_CHARACTERS.includes(nextCharacter) && lines.length > 1) { lineCount++; }
Don't know why you skip the last line to add lineCount.
Sorry, something went wrong.
No branches or pull requests
Description
Reproduction
code:
test txt file:
Environment
The text was updated successfully, but these errors were encountered: