b-pipe

0.0.3 • Public • Published

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
}

Readme

Keywords

none

Package Sidebar

Install

npm i b-pipe

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

2.76 kB

Total Files

7

Last publish

Collaborators

  • mishaszu