pick-random-stream

1.1.0 • Public • Published

pick-random-stream

Uniformly pick a random value from a stream

npm install pick-random-stream

build status

Usage

var random = require('pick-random-stream')
 
someStream.pipe(random()).on('data', function (data) {
  console.log('current random element is', data)
})

The random value will be chosen with propability 1/n where n is the total number of elements in the stream

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i pick-random-stream

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • mafintosh