p-limit runs multiple promise-returning or async functions with a configurable concurrency limit, so only a set number run at once. It is useful when you need to control parallel work in Node.js and browsers, and includes options like `clearQueue()` (optionally rejecting pending work) plus helpers like `limit.map()` and counters for active and pending promises.
Project status
- Actively maintained, with a very recent upstream push on 2026-08-31, and follow-up updates in the same week (v7.3.2 on 2026-08-31).
- Update cadence is fairly steady through 2026 (notably v7.3.x in July and August 2026), with a prior release earlier in 2026 (v7.3.0 on 2026-02-03), suggesting an ongoing evolution rather than a long freeze.
AI summary generated
Recent updates
v7.3.2
v7.3.2 fixes an issue where `limitFunction` queue clearing was not behaving correctly. The change ensures the returned limited function supports `clearQueue`, and the TypeScript types and tests are updated accordingly.
v7.3.1
v7.3.1 focuses on fixing the behavior of `limit.map` when the `map` method is detached from the `pLimit` instance. The code change replaces usage of `this` inside `map` with a stable closure reference, and the tests were updated to cover the detached-call scenario.
v7.3.0
v7.3.0 adds support for calling `pLimit()` with an options object (instead of only a concurrency number) and introduces a `rejectOnClear` option that affects what happens to pending tasks when `clearQueue()` is called. The implementation also refactors the queue items so pending promises can be rejected instead of being silently left unresolved.
Featuresv7.2.0
v7.2.0 extends p-limit's `LimitFunction.map` to accept any iterable, not only arrays. The implementation converts the provided iterable into an array before applying the concurrency-limited mapping, and the TypeScript types, README, and tests were updated accordingly.
Featuresv7.1.1
v7.1.1 is a small change release focused on TypeScript typings for `limitFunction`. The release notes only mention a type fix, but the diff shows the typing has been tightened in a way that can break existing TypeScript code.
v7.1.0
Release v7.1.0 documents an enhancement to p-limit's batch mapping helper. The `limit.map()` mapper callback now receives the input value along with the corresponding element index.
Featuresv7.0.0
v7.0.0 adds a new `limit.map(array, fn)` convenience method and updates the runtime behavior so `activeCount` increments when tasks actually start running (not when they are queued). The release also requires Node.js 20+ and includes an internal performance improvement aimed at reducing scheduling overhead.
BreakingFeaturesv6.2.0
This release adds a new named export, `limitFunction`, which wraps a promise-returning function so its invocations are throttled by a concurrency limit. It also updates the TypeScript declarations and README to document the new API, and adds a corresponding test.
Featuresv6.1.0
v6.1.0 introduces support for changing the concurrency limit after creating a limiter instance. The code adds a new public `concurrency` property (getter and setter) on the limiter, and updates scheduling logic so the queue respects the (possibly updated) concurrency value.
Featuresv6.0.0
Release v6.0.0 focuses on an internal performance improvement (#83). It also changes the update timing of p-limit’s internal counters (activeCount and pendingCount), which the release notes call out as the reason for a major version.
Breakingv5.0.0
Release v5.0.0 updates p-limit to require Node.js 18 and includes a fix for AsyncResource propagation so async execution context is preserved across limited concurrency runs. The code changes also add infrastructure to support non-Node environments (via a stubbed async hooks implementation) and adjust TypeScript declaration structure.
Breakingv4.0.0
p-limit v4.0.0 switches the package to ESM (including TypeScript typings) and updates the supported Node.js versions. The code diff also includes a major dependency upgrade (yocto-queue) and changes to the published type API surface.
Breaking