Skip to content

A utility that captures metrics over time (like streams) and reports them at stated intervals

Notifications You must be signed in to change notification settings

terryweiss/Progressor

Repository files navigation

Progress Stream

A transform that you can insert anywhere in your chain to monitor what is happening in a stream.

Installing

npm install @terryweiss/ProgressStream

Constructor

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

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

Events

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

About

A utility that captures metrics over time (like streams) and reports them at stated intervals

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published