powerset-stream
Version:
Streams all the possible combinations of subsets of the set given in input
44 lines (29 loc) • 755 B
Markdown
powerset-stream
===========
A readable stream that generates all the possible combinations of subsets of the set given in input.
[](http://badge.fury.io/js/powerset-stream)
[](https://travis-ci.org/mariocasciaro/powerset-stream)

## Install
### Node.js
```
npm install powerset-stream
```
## Usage
```javascript
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
* [Mario Casciaro](https://github.com/mariocasciaro) - Author