1.0.1 • Published 6 years ago

pipe-helper v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

A Borwser Compative Pipeline Function, Write In ES5

var pipe = require('pipeline')

var a = function (_) { return _ + 'a' }

var b = function (_) { return _ + 'b' }

var pipeFn = pipe(a, b)
pipe('1') // '1ab'
pipe('2') // '2ab'

var c = function (x, y) { return x + y }

var pipeFn2 = pipe(c, a, b)
pipe(1, 2) // '3ab'
pipe(2, 4) // '6ab'