async-tail

v1.0.1
An asynchronous file tailer, which survives unlink() and rename operations
tail

async-tail

Build Status License Docs

NPM

A zero-dependency file-tailer that exposes an async interface and handles unlink() and rename() events

Install

$ npm install async-tail

Usage

const FileTailer = require("async-tail").default;

const main = async () => {
    const tailer = new FileTailer("/tmp/foo");
    setTimeout(() => tailer.stop(), 10000); // stop tailing after 10 seconds
    for await (const line of tailer.watch()) {
        console.log("received", line);
    }
}
npm i async-tail

Metadata

  • Apache-2.0
  • >=12.9.0
  • James SigurĂ°arson
  • released 12/4/2021

Downloads

Maintainers