Skip to content

heapwolf/pipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build-status

SYNOPSIS

Provides pipes by operator instead of a chain.

DESCRIPTION

Pipe streams together with a simpler syntax, like a | b | c

EXAMPLES

pipe does not require through, i just like using through.

var through = require('through')
require('pipe').install()

var a = through(function(d) {
  this.queue(d.toString().toUpperCase())
})

var b = through(function(d) {
  this.queue(d.split('-').join(','))
})

var c = through(function(d) {
  this.queue(d.split(',').reverse().toString())
})

a | b | c | process.stdout

a.write('a-s-d-f') // OMG WTF? => F,D,S,A

It is also possible to to install pipe directly by requiring the register module which can be handy with ES6:

import 'pipe/register'

// Instead of:
import pipe from 'pipe'
pipe.install()

About

Unix style pipes for nodejs streams `streamA | streamB | streamA`

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published