A transform that you can insert anywhere in your chain to monitor what is happening in a stream.
npm install @terryweiss/ProgressStream
new ProgressStream(options)
Creates a new instance of a Progress Stream. The result is a TransformStream that be piped. For instance:
const input = readFile();
const output = readFile();
const ps = new ProgressStream(options)
input.pipe(ps).pipe(output);
options
:object - The options for the stream. These are passed directly to the stream and any leftovers are used
by this class.
options
.progressAt
:number - Progress will be reported whenever the stream counter equals or exceeds
since the last time progress was reported.
options
.total
: number - If this is none-zero the stream will calculate percent complete
meter
- Raise this event tell the meter that something has happened and it should be counted
start
- Raise this event to tell the stream to start monitoring
stop
- Raise this event to tell the stream to stop monitoring