Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…
A streaming interface to reservoir sampling
A streaming interface to do reservoir sampling by using the great reservoir module.
npm install reservoir-stream
// use a reservoir size of 3 var stream = require('reservoir-stream')(3) var inputStream.pipe(stream).pipe(outputStream)// 3 random elements from the inputStream will be piped to the outputStream
What happens when npm’s amazing community gets together to share with one another? Buy a ticket »
how? learn more