A zero-dependency file-tailer that exposes an async interface and handles unlink() and rename() events
$ npm install async-tail
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);
}
}