2.0.4 • Published 4 years ago

read-until-deleted v2.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

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

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

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

Exceptions

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

2.0.4

4 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago