Socket
Book a DemoInstallSign in
Socket

subtract-stream

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subtract-stream

subtract the values of the last object from the values of the current object and stream the diffs. also numbers

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 18 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts