Creates a readable stream that tails a file, emitting new data as it is appended.
A tuple containing the readable stream and a cancel function to stop tailing the file.
const [readableTailStream, stopTailFn] = tailStream('path/to/file.txt');for await (const chunk of readableTailStream) { console.log('New data appended:', Buffer.from(chunk).toString());}// To stop tailing the file, call the stopTailFn() function Copy
const [readableTailStream, stopTailFn] = tailStream('path/to/file.txt');for await (const chunk of readableTailStream) { console.log('New data appended:', Buffer.from(chunk).toString());}// To stop tailing the file, call the stopTailFn() function
Creates a readable stream that tails a file, emitting new data as it is appended.