Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Promises
  3. p-queue

p-queue

MITTypeScriptv9.3.3

A promise queue with concurrency control for rate-limiting async operations.

GitHubGitHub
4.2k stars213 forks0 contributors

What is p-queue?

p-queue is a JavaScript library that provides a promise queue with configurable concurrency control and rate limiting. It helps developers manage asynchronous operations by limiting how many tasks run simultaneously and enforcing execution rates over time intervals. This is essential for preventing resource exhaustion when interacting with APIs or performing intensive computations.

Target Audience

JavaScript and Node.js developers who need to manage concurrent async operations, particularly those working with rate-limited APIs, performing batch processing, or implementing task scheduling with priority control.

Value Proposition

Developers choose p-queue for its comprehensive feature set including priority scheduling, strict rate limiting modes, abort support, and detailed monitoring capabilities. It offers more control and reliability than simpler concurrency libraries while maintaining a clean API.

Overview

Promise queue with concurrency control

Use Cases

Best For

  • Rate-limiting API calls to external services
  • Managing concurrent database operations
  • Controlling CPU-intensive task execution
  • Implementing priority-based task scheduling
  • Preventing resource exhaustion in batch processing
  • Debugging and monitoring async task execution

Not Ideal For

  • Servers requiring persistent or distributed job queues (e.g., Redis-backed systems for scalability)
  • Projects locked into CommonJS modules without ESM migration plans
  • Teams seeking active development, regular feature updates, or email support
  • Simple concurrency control without need for rate limiting, priorities, or advanced monitoring

Pros & Cons

Pros

Fine-Grained Concurrency Control

Allows precise setting of concurrency levels via the concurrency option, preventing resource exhaustion during async operations like API calls or CPU-intensive tasks.

Advanced Rate Limiting

Supports both fixed-window and strict sliding-window modes with intervalCap and interval, essential for complying with strict API rate limits and preventing bursts.

Priority Scheduling

Tasks can be assigned numeric priorities and dynamically updated with setPriority, enabling critical operations to jump the queue for better workflow management.

Comprehensive Monitoring

Events (e.g., idle, rateLimit) and properties like runningTasks and isSaturated provide deep insights into queue performance, aiding debugging and optimization.

Cons

ESM-Only Restriction

No CommonJS export, forcing projects to migrate to ESM; the README warns against issues and offers no workaround, which can be a barrier for legacy codebases.

Maintenance Mode

Project is feature complete with no further development planned and no email support, limiting long-term viability for teams needing updates or bug fixes.

Complex Error Handling

Using .clear() can leave promises unsettled, risking dangling promises, and requires careful AbortSignal management to avoid unhandled rejections, adding overhead.

Frequently Asked Questions

Quick Stats

Stars4,244
Forks213
Contributors0
Open Issues2
Last commit1 day ago
CreatedSince 2016

Tags

#concurrency-control#queue#async-operations#npm-package#async-functions#nodejs#priority-queue#node-module#async-queue#javascript#rate-limiting#promise#task-scheduling

Built With

J
JavaScript

Included in

Promises1.7k
Auto-fetched 5 hours ago

Related Projects

p-limitp-limit

Run multiple promise-returning & async functions with limited concurrency

Stars2,906
Forks137
Last commit3 days ago
pifypify

Promisify a callback-style function

Stars1,505
Forks73
Last commit20 hours ago
p-mapp-map

Map over promises concurrently

Stars1,504
Forks74
Last commit3 days ago
p-retryp-retry

Retry a promise-returning or async function

Stars1,024
Forks84
Last commit3 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub