subtract-stream

0.0.2 • Public • Published

Build Status

subtract-stream

subtract the values of the last object from the values of the current object and stream the diffs

var sub = require('subtract-stream');
var s = sub();

s.on('data',function(d){
  console.log('data',d);
});

s.write({v:0});
s.write({v:2});
s.write({v:4});
s.write({v:6});
s.write({v:8});

output

data { v: 2 }
data { v: 2 }
data { v: 2 }
data { v: 2 }

you can also just emit numbers and it will subtract them

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    2
  • 0.0.1
    1

Package Sidebar

Install

npm i subtract-stream

Weekly Downloads

3

Version

0.0.2

License

none

Last publish

Collaborators

  • soldair