# read-until-deleted

> Read a file, tailing it for changes, until it's deleted

Latest version **2.0.4** (published 2020-04-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install read-until-deleted
pnpm add read-until-deleted
yarn add read-until-deleted
bun add read-until-deleted
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2020-04-07 |
| First published | 2018-05-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 10.0.0 |
| Dependencies | 1 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Aria Stewart |
| Maintainers | aredridel |
| Keywords | stream, tail |

## Links

- npm: https://www.npmjs.com/package/read-until-deleted
- Repository: https://github.com/aredridel/read-until-deleted
- Homepage: https://github.com/aredridel/read-until-deleted#readme
- Issues: https://github.com/aredridel/read-until-deleted/issues
- npm.io page: https://npm.io/package/read-until-deleted

## Dependencies (1)

- [fd-read-stream](https://npm.io/package/fd-read-stream.md) ^1.1.0

## 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

- 2.0.4 (latest) — 2020-04-07
- 2.0.3 — 2018-11-01
- 2.0.2 — 2018-05-04
- 2.0.1 — 2018-05-04
- 2.0.0 — 2018-05-04
- 1.1.1 — 2018-05-02
- 1.1.0 — 2018-05-01
- 1.0.1 — 2018-05-01
- 1.0.0 — 2018-05-01

## README

read-until-deleted
==================

Yet another file tailing module.

Simply reads a file until it is quiet after being deleted, including following renames.

This lets log rotation follow files, keep reading any data written into them as log rotation flushes logs out.

Synopsis
--------

```javascript
const readUntilDeleted = require('read-until-deleted')

function readUntilDeleted(filename, { timeout: 10000, start: 0 }) -> Promise<Stream>
```

The timeout is how long a file that has been deleted will be watched for new input

The start position is where to start reading in the file.

Example
-------

```javascript
const reader = await readUntilDeleted('test.file', { start: 1024 })
reader.pipe(process.stdout)
```


Exceptions
----------

Throws `{ code: "ENOENT" }` if the file does not exist

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