powerset-stream

0.1.0 • Public • Published

powerset-stream

A readable stream that generates all the possible combinations of subsets of the set given in input.

NPM version Build Status Downloads

Install

Node.js

npm install powerset-stream

Usage

 
powersetStream([1, 2, 3])
  .on('data', function(comb) {
    console.log(comb);
  });
 
/* Prints:
 
[ 1 ]
[ 2 ]
[ 3 ]
[ 1, 2 ]
[ 1, 3 ]
[ 2, 3 ]
[ 1, 2, 3 ]
 
*/
 

Credits

Package Sidebar

Install

npm i powerset-stream

Weekly Downloads

4

Version

0.1.0

License

none

Last publish

Collaborators

  • mariocasciaro