A simple promise-based asynchronous queue for Node.js, version 1.3.0. It provides a basic FIFO queue with push and pop methods, where pop returns a promise that resolves when an item is available. The queue length can be negative if pop is called more times than push, which may be surprising. It uses an event-driven approach (length-changed event) for managing workers. Since it is lightweight and minimal, it suits simple async workflows where a full-featured library like async.queue or bull is overkill. The package has no dependencies and is small, but is in maintenance mode with no recent updates since 2015. It does not support backpressure, concurrency limits, or persistence.
npm install then-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a queue, pushing items, popping them asynchronously, and listening to the length-changed event.
Monitor length carefully or ensure you push before pop.
Always ensure items are pushed eventually or use a timeout pattern.
Consider migrating to modern alternatives like async.queue or bull.
Use `new Queue()` instead of `Queue()`.
Use `var q = new Queue();`
Ensure you have required and instantiated the Queue correctly.
Only call pop after push, or implement a timeout/graceful handling.
Use standard Node event emitter pattern; ensure you have required 'events' if needed, but then-queue includes it.
No dependency data recorded yet.