0.0.3 • Published 6 years ago

b-pipe v0.0.3

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

b-pipe

Creating functions pipe. If you'd like to create function chain, where first function output is second function input.

how to

B-pipe accept function as parameter and return pipe function. Functions are executed in order, from first to last.

const pipe = require('b-pipe')

const my_pipe = pipe(func1, func2, func3)

//or

pipe(func1, func2, func3).("test")

Example

const pipe = require('b-pipe')

console.log(pipe(add, multi).(10)) // returns 30

function add(num) {
  return num + 5
}

function multi(num) {
  return num * 2
}
0.0.3

6 years ago

0.0.2

7 years ago

0.0.1

7 years ago