2.1.0 • Published 5 years ago

pure-stream v2.1.0

Weekly downloads
217
License
MIT
Repository
github
Last release
5 years ago

pure-stream

Collection of utilities for working with object streams

npm

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
# or
$ 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);
  // Output:
  // 2
  // 4
  // 6
})
.done((err) => {
  if (err) console.log('Error:', err);
  else console.log('Success');
});

Usage

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago