A streaming interface to do reservoir sampling
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
README.md
package.json
reservoir-stream.js

README.md

#reservoir-streambuild status

A streaming interface to do reservoir sampling by using the great reservoir module.

installation

npm install reservoir-stream

demo/usage

// 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