
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
map-merge.s
Advanced tools
Merges packets of two streams using map function
npm install map-merge.s
var merge = require('../lib/map-merge.s.js');
var numbers = require('stream-spectrum/readable/number');
var inspect = require('inspect-stream');
var sum = merge(function (first, second, done) {
done(null, first + second);
});
var power = merge(function (first, second, done) {
done(null, Math.pow(first, second));
});
numbers({ from: 1, to: 8, objectMode: true }).pipe(sum);
numbers({ from: 2, to: 9, objectMode: true }).pipe(sum);
sum.pipe(inspect()); // Outputs 3, 5, 7, 9, 11, 13, 15, 17
numbers({ from: 1, to: 4, objectMode: true }).pipe(power);
numbers({ from: 1, to: 3, objectMode: true }).pipe(power);
power.pipe(inspect()); // Outputs 1, 4, 27. Last packet (4^?) was droped
var merge = require('map-merge.s');
Creates transform stream that will merge packets from
two streams using map
function
Function
. Accepts
Mixed
Packet from first streamMixed
Packet from second streamFunction
Accepts error and result of mappingNote: If one of streams is longer, then packets from it will be droped
FAQs
Merges packets of streams using map function
We found that map-merge.s demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.