|
il y a 2 ans | |
---|---|---|
.. | ||
index.d.ts | il y a 2 ans | |
index.js | il y a 2 ans | |
license | il y a 2 ans | |
package.json | il y a 2 ans | |
readme.md | il y a 2 ans |
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.