1.0.1 • Published 9 years ago
seal-countingstream v1.0.1
seal-countingstream
seal-countingstream counts the stream length in bytes.
Installation
$ npm install seal-countingstreamQuick start
First you need to add a reference to seal-countingstream within your application.
const CountingStream = require('seal-countingstream');Then, call the constructor function.
const countingstream = new CountingStream();CountingStream is derived from the Transform stream and can be used like any such stream. To get the number of bytes piped through, call:
const numberOfStreamedBytes = countingstream.getCount(); // -> returns the number of bytes streamed so farYou can reset the counter any time.
countingstream.resetCount();It is also possible to set the counter to an arbitrary value.
countingstream.resetCount(42);
countingstream.getCount(); // -> returns 42Running the build
To build this module use roboter.
$ bot1.0.1
9 years ago