API Reference
p-waterfall
Run async tasks in sequence, passing each result to the next task in chain.
Official Documentation ↗CompatibilityThis documentation covers version
v3.0.0. Check the official docs for the latest API surface.Installation
npm
npm install p-waterfallpnpm
pnpm add p-waterfallMethods
No methods match this filter.
p-waterfall is run async tasks in sequence, passing each result to the next task in chain.
Key Features
- resilience: Designed for resilience scenarios with a focused API surface.
Installation
npm install p-waterfall
Usage
API reference evidence
Fetched from official sources on 2026-11-08T18:27:00+08:00 via WebFetch https://raw.githubusercontent.com/sindresorhus/p-waterfall/main/index.d.ts.
p-waterfall.waterfall→ signature from https://raw.githubusercontent.com/sindresorhus/p-waterfall/main/index.d.ts; official text: “export default function pWaterfall( tasks: Iterable<Task<unknown, unknown>>, initialValue?: unknown ): Promise;”
FAQ
- How does p-waterfall handle concurrency?
- Pass { concurrency: N } in options to cap concurrent operations. Default runs all in parallel.
- Does p-waterfall stop on the first rejection?
- Yes, by default the first rejection short-circuits. Use settle variants to collect all outcomes.
- Is p-waterfall tree-shakeable?
- Yes, p-waterfall ships ESM and named exports, enabling bundlers to tree-shake unused functions.
Report a problem with this API docOpens a pre-filled issue on GitHub.