Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

autovance/pure-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🔧 Collection of utilities for working with native streams

Resources

Stars

Watchers

Forks

Packages

No packages published