HappyEnd
Group streams so that they end together
This helps in situations where you want to trigger an action only after a few different streams end.
Example:
let group = let streams = fs fs streams let finished = group // Each call to "add" returns the same promise finished
Installation
npm install happy-end
API
group.add([streams]) / group.add(stream)
Accepts either a single stream or an array of streams to add to the group. Returns a promise that resolves to the number of ended streams (see example above).
Contributions / Issues
This project is still very new and has not been widely tested yet. Please feel free to open an issue or a PR if something's broken, or if you'd like some specific features added.
This was tested for readable, writable and transform streams (which were my use cases). If this doesn't work with your favorite stream, please open an issue or PR.
License
MIT