uinix-fp-pipe
v1.0.0
Published
uinix fp identity utility
Downloads
6
Readme
uinix-fp-pipe
uinix-fp
pipe utility.
Install
This package is ESM-only and requires Node 12+.
npm install uinix-fp-pipe
Use
pipe
allows chaining a sequence of functions in a pipeline.
import {pipe} from 'uinix-fp-pipe';
const greet = x => 'hello ' + x;
const uppercase = x => x.toUpperCase();
const exclaim = x => x + '!';
const shout = pipe([
greet,
uppercase,
exclaim
]); // curried
shout('Jesse'); // 'HELLO JESSE!'
API
This package exports the following identifiers: pipe
. There is no default export.
pipe(fs)(x)
Parameters (Curried)
fs
(Function[]
) — An array of functions.x
(X
) — The input.
Returns
Y
— Output of transformingX
through the series of functions.