Zero-dependency promise-based priority queues for throttling, rate- and concurrency limiting of async tasks in Node.js and browsers. v2.1.4 (stable, actively maintained) provides O(log n) scheduling for numerous jobs with multiple priority levels. Distinguishes from other queues by full async/await compatibility, guaranteed order preservation, and never waking contexts that won't run. Suitable for rate-limiting API calls, controlling concurrent async loops, and parallelizing downloads. Ships TypeScript definitions and supports both ESM and CJS.
npm install async-await-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating a Queue with concurrency 2 and 100ms spacing, using wait/end for tasks, and flushing.
Always use .finally(() => queue.end(id)) or wrap in try/finally.
Use negative values for higher priority: e.g., -1 runs before 0.
Review changelog; v2 still uses same constructor. No code change needed but test thoroughly.
Use run() for simple concurrency limiting; use wait/end for priority support.
Always ensure every wait() is paired with an end() call, even on error.
Use named import: `import { Queue } from 'async-await-queue'`Ensure each wait() call uses a unique Symbol or string, and end() is called exactly once per id.
Add .catch() handler to the promise returned from the task, or use try/catch inside.
No dependency data recorded yet.