unstable-stream

0.2.0 • Public • Published

node-instable-stream

A stream detecting unstable behaviors.

var UnstableStream = require('unstable-stream');
 
// Create a new stream
// If data passed into the stream doesn't matches constraints,
// the 'instability' event will be emitted
var stream = new UnstableStream({
    max: 50, // Maximum value
    min: -60, // Minimum value
    maxDelta: 5, // Maximum distance between two values
    maxPeakDelta: 10 // Maximum distance between two peaks
});
 
stream.on('instability', function () {
    console.log('Instability detected!');
});
 
// Write numbers to the stream
stream.write(0);
stream.write(1);
stream.write(2);

Package Sidebar

Install

npm i unstable-stream

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • emersion