UNPKG

794 BMarkdownView Raw
1# Read Last N Lines
2
3[![NPM](https://nodei.co/npm/read-last-lines.png?compact=true)](https://nodei.co/npm/read-last-lines/)
4
5Read in the last N lines of a file efficiently using node.js and fs.
6
7## Installation
8
9``` bash
10npm install read-last-lines --save
11```
12
13## Usage
14
15example reading last 50 lines of a file
16``` javascript
17const readLastLines = require('read-last-lines');
18readLastLines.read('path/to/file', 50)
19 .then((lines) => console.log(lines));
20```
21
22## Contributing
23
241. Fork it on Github [https://github.com/alexbbt/read-last-lines](https://github.com/alexbbt/read-last-lines)
252. Create your feature branch: `git checkout -b my-new-feature`
263. Commit your changes: `git commit -am 'Add some feature'`
274. Push to the branch: `git push origin my-new-feature`
285. Submit a pull request :D