API Reference
p-reduce
Reduce an array to a single value by async reducer function in sequence.
Official Documentation ↗CompatibilityThis documentation covers version
v3.0.0. Check the official docs for the latest API surface.Installation
npm
npm install p-reducepnpm
pnpm add p-reduceMethods
No methods match this filter.
p-reduce is reduce an array to a single value by async reducer function in sequence.
Key Features
- resilience: Designed for resilience scenarios with a focused API surface.
Installation
npm install p-reduce
Usage
API reference evidence
Fetched from official sources on 2026-11-08T18:26:00+08:00 via WebFetch https://raw.githubusercontent.com/sindresorhus/p-reduce/main/index.d.ts.
p-reduce.reduce→ signature from https://raw.githubusercontent.com/sindresorhus/p-reduce/main/index.d.ts; official text: “export default function pReduce<ValueType, ReducedValueType = ValueType>( input: Iterable<PromiseLike| ValueType>, reducer: ReducerFunction<ValueType, ReducedValueType>, initialValue?: ReducedValueType ): Pro”
FAQ
- How does p-reduce handle concurrency?
- Pass { concurrency: N } in options to cap concurrent operations. Default runs all in parallel.
- Does p-reduce stop on the first rejection?
- Yes, by default the first rejection short-circuits. Use settle variants to collect all outcomes.
- Is p-reduce tree-shakeable?
- Yes, p-reduce 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.