
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
sorted-diff-stream
Advanced tools
given two sorted streams will emit only pairs that do not match
returns a function that can be used to create new diff
see test.js for API examples
var diffStream = require('sorted-diff-stream')
var through = require('through2')
var a = through()
var b = through()
var diffs = diffStream(a, b, isEqual, compare)
// this is the default `isEqual`, you dont have to pass one above
function isEqual (a, b, cb) {
cb(null, a.value === b.value)
// you can implement your own equality check here instead
}
// this is the default `compare`, you dont have to pass one above
function compare (a, b, cb) {
cb(null, a.key > b.key ? 1 : a.key < b.key ? -1 : 0)
// you can implement your own comparison here instead
}
diffs.on('data', function (diff) {
console.log(diff)
})
a.write({key: 1, value: 'a'})
a.write({key: 2, value: 'b'})
a.write({key: 3, value: 'c'})
a.write({key: 4, value: 'd'})
b.write({key: 1, value: 'a'})
b.write({key: 3, value: 'c'})
b.write({key: 4, value: 'd'})
b.write({key: 5, value: 'e'})
// console output:
// [{key: 2, value: 'b'}, null]
// [null, {key: 5, value: 'e'}]
FAQs
given two sorted streams will emit only pairs that do not match
We found that sorted-diff-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.