|
hace 2 años | |
---|---|---|
.. | ||
index.d.ts | hace 2 años | |
index.js | hace 2 años | |
license | hace 2 años | |
package.json | hace 2 años | |
readme.md | hace 2 años |
Compose promise-returning & async functions into a reusable pipeline
$ npm install p-pipe
const pPipe = require('p-pipe');
const addUnicorn = async string => `${string} Unicorn`;
const addRainbow = async string => `${string} Rainbow`;
const pipeline = pPipe(addUnicorn, addRainbow);
(async () => {
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.