p-pipe

Compose promise-returning & async functions into a reusable pipeline

MIT 8 个版本
安装
npm install p-pipe
yarn add p-pipe
pnpm add p-pipe
bun add p-pipe
README

p-pipe

Compose promise-returning & async functions into a reusable pipeline

Install

$ npm install p-pipe

Usage

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'

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…

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
版本列表
4.0.0 2021-04-08
3.1.0 2020-05-16
3.0.0 2019-04-06
2.0.1 2019-03-18
2.0.0 2019-02-04
1.2.0 2017-07-29
1.1.0 2017-05-12
1.0.0 2016-10-21