Skip to content
Compose promise-returning & async functions into a reusable pipeline
JavaScript TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Tidelift tasks Sep 10, 2019
.editorconfig Add support for specifying an array of arguments May 12, 2017
.gitattributes Meta tweaks Feb 4, 2019
.gitignore Meta tweaks Jul 29, 2017
.npmrc
.travis.yml Require Node.js 8, drop support for array input, and add TypeScript d… Feb 4, 2019
index.d.ts Fix TypeScript definition, refactor definition to CommonJS compatible… Apr 6, 2019
index.js Fix TypeScript definition, refactor definition to CommonJS compatible… Apr 6, 2019
index.test-d.ts Fix TypeScript definition, refactor definition to CommonJS compatible… Apr 6, 2019
license
package.json 3.0.0 Apr 6, 2019
readme.md Tidelift tasks Sep 10, 2019
test.js Always use a fresh iterator (#5) Mar 18, 2019

readme.md

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.

Related

  • 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.
You can’t perform that action at this time.