A readable stream that generates all the possible combinations of subsets of the set given in input.
npm install powerset-stream
powersetStream([1, 2, 3])
.on('data', function(comb) {
console.log(comb);
});
/* Prints:
[ 1 ]
[ 2 ]
[ 3 ]
[ 1, 2 ]
[ 1, 3 ]
[ 2, 3 ]
[ 1, 2, 3 ]
*/
- Mario Casciaro - Author