avg-stream

0.0.1 • Public • Published

Build Status

avg-stream

average the last n samples and emit the result as a stream

var avg = require('avg-stream');
 
var s = avg(2);
 
s.on('data',function(d){
  console.log(d);
})
 
s.write({a:1,b:2})
s.write({a:3,b:1})
s.write({a:2,b:4})
 

output

{ a: 1, b: 2 }
{ a: 2, b: 1.5 }
{ a: 2.5, b: 2.5 }

Readme

Keywords

none

Package Sidebar

Install

npm i avg-stream

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • soldair