You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
825 B
29 lines
825 B
# Read Last N Lines
|
|
|
|
[](https://nodei.co/npm/read-last-lines/)
|
|
|
|
Read in the last N lines of a file efficiently using node.js and fs.
|
|
|
|
## Installation
|
|
|
|
``` bash
|
|
npm install read-last-lines --save
|
|
```
|
|
|
|
## Usage
|
|
|
|
example reading last 50 lines of a file
|
|
``` javascript
|
|
const readLastLines = require('read-last-lines');
|
|
readLastLines.read('path/to/file', 50)
|
|
.then((lines) => console.log(lines));
|
|
```
|
|
|
|
## Contributing
|
|
|
|
1. Fork it on Github [https://github.com/alexbbt/read-last-lines](https://github.com/alexbbt/read-last-lines)
|
|
2. Create your feature branch: `git checkout -b my-new-feature`
|
|
3. Commit your changes: `git commit -am 'Add some feature'`
|
|
4. Push to the branch: `git push origin my-new-feature`
|
|
5. Submit a pull request against the development branch :D
|