
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
sample-distribution
Advanced tools
small minimal quantile and CDF estimator for multiple large data streams
takes a large and continuous data stream and continuously only retain a reduced empirical CDF approximation
small, simple, no dependencies
• Example • Features • Limitations • Why • API • License
import Recorder from 'sample-distribution'
// recorder with 5 retained samples
var recorder = new Recorder(5)
[5,3,6,2,7,1,8].forEach(recorder.push, recorder)
console.log('minimum:', recorder.Q(0)) // minimum:0
console.log('median:', recorder.Q(0.5)) // median:4
console.log('maximum:', recorder.Q(1)) // maximum:8
This module attempts to match the underlying CDF as closely as possible by adjusting local ranks to keep the local average when discarding values.
By some measure, the root mean square error for each original sample value is 10 times better than the 2 other implementations above.
Type npm run compare or see ./util/compare.js for a benchmark and error comparison for multiple distribution types.
var recorder = new Recorder(L): creates a recorder that will keep L values and associated L ranks.N number: total samples received.E number: average of samples received and of the resulting approximated cdf.S number: standard variation of the resulting aproximated cdf.V number: variance of the resulting aproximated cdf.vs array: internal store of retained sample values.rs array: internal store of retained value approximated ranks.push(number) void: sample value(s) to be added.F(value:number) number: cummulative probability (cdf) of the specified value.f(value:number) number: probability density (pdf) of the specified value.Q(probability:number) number: estimated value for specified probability.M(order:number) number: estimated origin moment (ie. E = M(1), V=M(2)-E^2)const main = new Recorder( new Float64Array(buffer, offset, length) )const copy = new Recorder( main.data ) transferable TypedArrayFAQs
small minimal quantile and CDF estimator for multiple large data streams
We found that sample-distribution 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.