A promise queue with concurrency control for rate-limiting async operations.
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.
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.
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.
Promise queue with concurrency control
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows precise setting of concurrency levels via the concurrency option, preventing resource exhaustion during async operations like API calls or CPU-intensive tasks.
Supports both fixed-window and strict sliding-window modes with intervalCap and interval, essential for complying with strict API rate limits and preventing bursts.
Tasks can be assigned numeric priorities and dynamically updated with setPriority, enabling critical operations to jump the queue for better workflow management.
Events (e.g., idle, rateLimit) and properties like runningTasks and isSaturated provide deep insights into queue performance, aiding debugging and optimization.
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.
Project is feature complete with no further development planned and no email support, limiting long-term viability for teams needing updates or bug fixes.
Using .clear() can leave promises unsettled, risking dangling promises, and requires careful AbortSignal management to avoid unhandled rejections, adding overhead.