Read in the last N lines of a file efficiently using node.js and fs.
npm install read-last-lines --save
example reading last 50 lines of a file
const readLastLines = require('read-last-lines');
readLastLines.read('path/to/file', 50)
.then((lines) => console.log(lines));
- Fork it on Github https://github.com/alexbbt/read-last-lines
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D