npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

fj-pipe

1.1.0

@stoeffel

npmHomeRepoSnykSocket
Downloads:45
$ npm install fj-pipe
DailyWeeklyMonthlyYearly

fj-pipe

Build Status npm version

pipe with ease.

Installation

npm install fj-pipe --save

Usage

var pipe = require('fj-pipe');

const add1 = (x) => x + 1,
mult2 = (x) => x * 2,
square = (x) => x * x;

const pipe1 = pipe(add1),
pipe2 = pipe(add1, mult2),
pipe3 = pipe(add1, mult2, square);

pipe1(0); // 1
// === add1(0)

pipe2(1); // 4
// === mult2(add1(0))

pipe3(1); // 16
// === square(mult2(add1(0)))