|
2 lat temu | |
---|---|---|
.. | ||
index.d.ts | 2 lat temu | |
index.js | 2 lat temu | |
license | 2 lat temu | |
package.json | 2 lat temu | |
readme.md | 2 lat temu |
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.