stream-interface online statistics
npm install stream-statistics
This module exposes a single function that creates a stream. The stream
reads data, which it parses with
parseFloat(), and computes statistics
on that data. When the input stream ends,
stream-statistics emits the
The statistics object has the following members:
mode computation expects the stream to deliver numbers in sorted lowest-first
order, and will return
undefined if that expectation is not met.
var streamStatistics = require'stream-statistics'assert = require'assert';var rs = objectMode: true ;for var i = 10; i < 1000; i++ rspushi;rspushnull;return rs;rangeStream10 1000pipestreamStatisticson'data'assertequaldmin 10;;
This also provides a binary,
sstatistics, that you can get if you
npm install -g the library. Pipe numbers into it and it'll return
a basic set of stats about its input.