2 ms·
We have an inhouse solution which is basically a set of external functions that work with built in streams in a way that avoids frustration. Some of them can b
by spion 12y ago
We have an inhouse solution which is basically a set of external functions that work with built in streams in a way that avoids frustration.
Some of them can be found in https://github.com/spion/promise-streams https://github.com/spion/promise-streams - the others we haven't extracted to an npm module yet. (Promise streams also has a minimal extension of built in streams to make them work better with promises).
We never managed to find a full replacement though. Probably not worth the effort either given that it will always have to wrap existing streams, and the only drawback of external functions is that you cannot invoke them as methods. Although, one contender that I have hopes for is WHATWG streams [1].
note: to replace event emitters we built https://github.com/doxout/promise-observer https://github.com/doxout/promise-observer which gives you a lot more power and control in terms of execution order and goes away with the "multiple events per object" stringy design that makes things harder for typesystems like typescript/flow.
[1]: https://github.com/whatwg/streams https://github.com/whatwg/streams