Promise queue with concurrency control, priority, and rate limiting. Version 6.0.2 is stable and maintained. Allows limiting concurrent async operations, per-operation timeouts, interval-based rate limiting, and priority scheduling. Compatible with ES5 environments like older Node.js and some bundlers. Built as CommonJS with TypeScript declarations. No native dependencies. Lightweight alternative to bottleneck, p-limit, or async.queue.
npm install p-queue-es5No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a queue with concurrency 2 and rate limit of 5 tasks per second, adds 10 tasks, and waits for all to finish.
Consider upgrading to p-queue v7+ for ESM and new features, but note p-queue-es5 will not receive updates.
Use `const {default: PQueue} = require('p-queue-es5')` or `import PQueue from 'p-queue-es5'`.Ensure queue is started (start()) after adding tasks if autoStart is false.
Always handle promise rejections when using timeout with throwOnTimeout: false.
Install 'p-queue' instead of 'p-queue-es5' for non-ES5 environments.
Use const {default: PQueue} = require('p-queue-es5') or import PQueue from 'p-queue-es5'.Run npm install p-queue-es5 which includes eventemitter3 as a dependency.
Pass a function (sync or async) that returns a promise: queue.add(() => myAsyncFunction()).
Only call .onEmpty() on a valid PQueue instance. It returns a promise, not a function.