Skip to content

subtract the values of the last object from the values of the current object and emit the diff

License

Notifications You must be signed in to change notification settings

soldair/node-subtract-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

subtract the values of the last object from the values of the current object and emit the diff

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published