pure-stream
Collection of utilities for working with object streams
About
This library uses a new class PureStream
to implement object streams in an easy and logical way.
- PureStreams are
ended
when an error occurs pipe
-ing propagates errors from source to destination(s)- No events. Data is collected with
each
and ended with done
PureStreams are lazy, they won't begin reading data until .done
is called.
Install
$ npm install pure-stream
$ yarn add pure-stream
Quick-Start
import {from, map} from 'pure-stream';
from([1, 2, 3])
.pipe(map((value) => value * 2))
.each((value) => {
console.log(value);
})
.done((err) => {
if (err) console.log('Error:', err);
else console.log('Success');
});
Usage