uinix-fp-pipe
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

uinix-fp-pipe

Build Coverage Downloads Size

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 transforming X through the series of functions.

License

MIT © Chris Zhou

Readme

Keywords

Package Sidebar

Install

npm i uinix-fp-pipe

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

2.97 kB

Total Files

4

Last publish

Collaborators

  • chrisrzhou