read-until-deleted

2.0.4 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i read-until-deleted

Weekly Downloads

2

Version

2.0.4

License

ISC

Unpacked Size

4.87 kB

Total Files

4

Last publish

Collaborators

  • aredridel