npm.io
0.1.0 • Published 12 years ago

permutation-stream

Licence
MIT
Version
0.1.0
Deps
3
Vulns
1
Weekly
0

node-permutation-stream

Create a stream of permutations

API

createPermutationStream(data[, opts])

Creates a stream of permutations of the data array. Arrays are emitted by the stream.

opts

  • min - minimum numbers of items in the output (default: 0)
  • max - maximum number of items to output (default: data.length)
var ps = require('permutation-stream');
var es = require('event-stream');

var s = ps.createPermutationStream(['hello', 'world']);
s.pipe(process.stdout);

> []
> ["hello"]
> ["world"]
> ["hello","world"]
> ["world","hello"]

Keywords