A JavaScript asynchronous queue that implements a producer-consumer pattern using ES6 classes and Promises. Version 1.1.4 (stable) provides methods like push, shift, pop, and unshift where shift and pop return Promises that resolve when items become available. Built on a LinkedList for efficient O(1) operations, it avoids the performance pitfalls of using Array.shift() on large arrays. Main differentiator: it's a lightweight, ready-to-use async queue without external dependencies, supporting both ESM imports and CommonJS requires.
npm install wait-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates async producer-consumer pattern using push and shift.
Ensure items are pushed eventually, or use a timeout mechanism (not built-in).
Use the provided methods (push, shift, etc.) instead of mutating queue directly.
After empty(), call clearListeners() to reject pending shift/pop promises.
No API changes, but performance characteristics differ; benchmark your use case.
Use `const WaitQueue = require('wait-queue');` (CommonJS) or `import WaitQueue from 'wait-queue';` (ESM).Run `npm install wait-queue` and use the correct import: `import WaitQueue from 'wait-queue';`.
Ensure that push() is called somewhere in your code to add items.
No dependency data recorded yet.