JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2780683
  • Score
    100M100P100Q199236F
  • License MIT

Compose promise-returning & async functions into a reusable pipeline

Package Exports

  • p-pipe

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (p-pipe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

p-pipe Build Status

Compose promise-returning & async functions into a reusable pipeline

Install

$ npm install p-pipe

Usage

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'
})();

API

pPipe(input…)

The input functions are applied from left to right.

input

Type: Function

Expected to return a Promise or any value.

  • p-each-series - Iterate over promises serially
  • p-series - Run promise-returning & async functions in series
  • p-waterfall - Run promise-returning & async functions in series, each passing its result to the next
  • More…

License

MIT © Sindre Sorhus