$ gnpm install p-pipe
Compose promise-returning & async functions into a reusable pipeline
$ npm install p-pipe
import pPipe from 'p-pipe';
const addUnicorn = async string => `${string} Unicorn`;
const addRainbow = async string => `${string} Rainbow`;
const pipeline = pPipe(addUnicorn, addRainbow);
console.log(await pipeline('❤️'));
//=> '❤️ Unicorn Rainbow'
The input
functions are applied from left to right.
Type: Function
Expected to return a Promise
or any value.
Copyright 2013 - present © cnpmjs.org | Home |