# read-last-lines

> Read in the last N lines of a file efficiently using node.js and fs.

Latest version **1.10.0** (published 2026-08-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install read-last-lines
pnpm add read-last-lines
yarn add read-last-lines
bun add read-last-lines
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.10.0 |
| Published | 2026-08-05 |
| First published | 2016-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 55 |
| Author | Alexander Bell-Towne |
| Maintainers | alexbbt |
| Keywords | read, lines, last, file, read |

## Links

- npm: https://www.npmjs.com/package/read-last-lines
- Repository: https://github.com/alexbbt/read-last-lines
- Homepage: https://github.com/alexbbt/read-last-lines#readme
- Issues: https://github.com/alexbbt/read-last-lines/issues
- npm.io page: https://npm.io/package/read-last-lines

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.10.0 (latest) — 2026-08-05
- 1.9.0 — 2026-08-04
- 1.8.0 — 2021-01-11
- 1.7.2 — 2020-01-14
- 1.7.1 — 2019-04-05
- 1.7.0 — 2019-03-13
- 1.6.0 — 2018-07-16
- 1.5.0 — 2018-06-18
- 1.4.0 — 2018-02-28
- 1.3.0 — 2017-11-20
- 1.2.0 — 2017-07-02
- 1.1.4 — 2017-07-02
- 1.1.3 — 2017-07-02
- 1.1.2 — 2017-03-16
- 1.1.1 — 2017-03-16
- … 5 more at https://npm.io/package/read-last-lines/versions

## README

# Read Last N Lines

[![NPM](https://nodei.co/npm/read-last-lines.png?compact=true)](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

> More details can be found in [CONTRIBUTING.md](CONTRIBUTING.md)

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.

---
_Source: https://npm.io/package/read-last-lines · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
