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 |
|
5 | Read in the last N lines of a file efficiently using node.js and fs.
|
6 |
|
7 | ## Installation
|
8 |
|
9 | ``` bash
|
10 | npm install read-last-lines --save
|
11 | ```
|
12 |
|
13 | ## Usage
|
14 |
|
15 | example reading last 50 lines of a file
|
16 | ``` javascript
|
17 | const readLastLines = require('read-last-lines');
|
18 | readLastLines.read('path/to/file', 50)
|
19 | .then((lines) => console.log(lines));
|
20 | ```
|
21 |
|
22 | ## Contributing
|
23 |
|
24 | 1. Fork it on Github [https://github.com/alexbbt/read-last-lines](https://github.com/alexbbt/read-last-lines)
|
25 | 2. Create your feature branch: `git checkout -b my-new-feature`
|
26 | 3. Commit your changes: `git commit -am 'Add some feature'`
|
27 | 4. Push to the branch: `git push origin my-new-feature`
|
28 | 5. Submit a pull request :D
|