p-limit

Run multiple promise-returning functions with limited concurrency. p-limit creates a concurrency limiter that ensures only a specified number of async operations run simultaneously. Essential for agent systems that make many parallel API calls but need to respect rate limits — process 1000 items with max 10 concurrent requests.

Evaluated Mar 06, 2026 (0d ago) v6.x
Homepage ↗ Repo ↗ Developer Tools javascript typescript async concurrency throttling promises utilities
⚙ Agent Friendliness
70
/ 100
Can an agent use this?
🔒 Security
99
/ 100
Is it safe for agents?
⚡ Reliability
92
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
90
Error Messages
88
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
95
Secret Handling
100

Local utility library — no network access or credentials. Zero security concerns.

⚡ Reliability

Uptime/SLA
100
Version Stability
90
Breaking Changes
85
Error Recovery
92
AF Security Reliability

Best When

You need to process many promises with a concurrency limit — the simplest solution for 'max N parallel requests' in JavaScript.

Avoid When

You need RPS rate limiting, priority ordering, or persistent job queuing — use p-queue or bottleneck respectively.

Use Cases

  • Limit concurrent LLM API calls in agent batch processing pipelines to avoid rate limit errors
  • Process large datasets in agent workflows with controlled parallelism to prevent memory exhaustion
  • Batch embed documents in agent knowledge base builders with concurrency limits matching API rate limits
  • Scrape multiple URLs in agent data pipelines with controlled parallelism to respect robots.txt limits
  • Make N concurrent API requests in agent orchestrators that need results from many external services

Not For

  • Priority queuing — p-limit is FIFO; use p-queue for priority-based queuing
  • Rate limiting per second (RPS) — p-limit controls concurrency, not request rate; use bottleneck for RPS control
  • Work queues that survive process restarts — p-limit is in-memory only

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Local utility library — no authentication.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Completely free and open source.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • p-limit v6+ is ESM-only — requires import syntax; CJS require() is not supported without dynamic import()
  • The limit function wraps a function, not a promise — wrap the function that returns a promise, not the promise itself
  • Failed promises count as completed slots — a rejected promise frees a concurrency slot; no special handling needed for errors
  • p-limit doesn't retry failed requests — combine with p-retry if you need automatic retry with concurrency control
  • All queued items accumulate in memory — queuing millions of items creates memory pressure; batch your input instead of queuing everything at once
  • Concurrency limit is per-limiter-instance — create separate limiters for different rate-limit groups (e.g., one per API endpoint with different limits)

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for p-limit.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered