last-line-stream
A PassThrough stream that keeps track of last line written.
Install
$ npm install --save last-line-stream
Usage
const lastLineStream = ; const stream = ; stream; ; stream; ; stream; ;
API
lastLineStream([pipeTo])
Returns a new instance of the spying PassThrough stream,
pipeTo
Type: stream
If supplied, the new instance will automatically be piped to this stream.
stream.lastLine
Type: string
The last line written out to this stream. The lastLine
value will grow until the stream sees a newline character ('\n'
).
Low Level API
A low-level non-stream based API is available. It has only two methods.
var createTracker = ;var tracker = ; // append some text.tracker; // Find the complete last line of all the text appended.tracker;
License
MIT © James Talmage