lucagrulla / node-tail

The zero dependency Node.js module for tailing a file
https://www.lucagrulla.com/node-tail/
MIT License
467 stars 75 forks source link

Crashes when using `nLines` with large files #161

Closed MrDiggles2 closed 1 year ago

MrDiggles2 commented 1 year ago

Hello! Big fan of this library.

I noticed that when using the nLines option with larger files (2GB+), the application will crash.

I believe it's due to this bit of code here: https://github.com/lucagrulla/node-tail/blob/master/src/tail.js#L56-L59

I realize this is an edge case; would you open to accepting a PR to account for this?

lucagrulla commented 1 year ago

Hello @MrDiggles2,

Thanks for flagging this. I'll be happy to consider a PR, as much as it's not changing existing behaviours.