Ubend
Wraps a NodeJS stream pipe chain in a Duplex stream.
Ubend is a light wrapper around pump.
The problem
I often write NodeJS transform streams that are designed to work together as a pipeline:
{ var first = ; var second = ; var third = ; first ; return first;} ;
This is nice because each intermediate stream can be tested and reused separately, but it is also cumbersome:
- I need to keep a handle on (at least)
first
- I have no satisfying way of getting the data out of
third
- Error handling is a nightmare
What I really want is to be able to treat the entire pipeline as a Duplex stream with sane error handling built in.
Installing
npm install --save ubend
Usage
const ubend = ; { return ;} ;
Much more elegant.
ubend is based on pump and has the exact same API, except that it returns a Duplex stream instead of returning the last stream in the pipeline.
Ubend ONLY works with Duplex streams, obviously, and is specifically intended for use with Transform streams.
Roadmap
- More tests