# tail-forever

> a node.js library to implement tail -F

Latest version **0.3.16** (published 2019-04-23) · 0 weekly downloads

## Install

```sh
npm install tail-forever
pnpm add tail-forever
yarn add tail-forever
bun add tail-forever
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.16 |
| Published | 2019-04-23 |
| First published | 2014-07-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mingqi Shao |
| Maintainers | megastef, shaomq |
| Keywords | tail |

## Links

- npm: https://www.npmjs.com/package/tail-forever
- Repository: https://github.com/mingqi/tailF
- Issues: https://github.com/mingqi/tailF/issues
- npm.io page: https://npm.io/package/tail-forever

## Dependencies (4)

- [jschardet](https://npm.io/package/jschardet.md) *
- [iconv-lite](https://npm.io/package/iconv-lite.md) *
- [underscore](https://npm.io/package/underscore.md) *
- [uclogs-async](https://npm.io/package/uclogs-async.md) *

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 0.3.16 (latest) — 2019-04-23
- 0.3.15 — 2017-01-27
- 0.3.14 — 2017-01-27
- 0.3.13 — 2016-07-21
- 0.3.12 — 2016-07-21
- 0.3.11 — 2014-11-03
- 0.3.10 — 2014-10-20
- 0.3.9 — 2014-10-20
- 0.3.8 — 2014-10-20
- 0.3.7 — 2014-10-19
- 0.3.6 — 2014-10-19
- 0.3.5 — 2014-10-19
- 0.3.4 — 2014-10-19
- 0.3.3 — 2014-10-17
- 0.3.2 — 2014-10-16
- … 4 more at https://npm.io/package/tail-forever/versions

## README

tailF
=====

a node.js library to implement tail -F. The power than tail -F is: it can watch a not exist file, also can continue watch file after file was removed.

# install
```bash
npm install tail-forever
```

# Use
## simple case
```javascript
Tail = require('tail-forever');

tail = new Tail("fileToTail");
tail.on("line", function(line) {
  console.log(line);
});
tail.on("error", function(error) {
  console.log('ERROR: ', error);
});
````

## save postion can continue watch next time
if you applicaiton down or have to restart, you want to continue watch file from last postion to avoid lost data during down time. you can do it like this:

```javascript
// unwatch return opsition which has two attributes: inode and pos. inode is the file's inode and pos is position where watched. you can save it on persistent file or database.
position = tail.unwatch()

// watch file after application restart. 
new Tail('/file/path', {start: position.pos, inode: position.inode})

```

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