Event-based queue iteration library for JavaScript (v2.3.0). Allows creating asynchronously filled queues from event emitters or iterables, then iterating over them with forward/backward directions. Supports appending, prepending (listen), and intercepting queues. Key differentiator: queues can be populated before or after iterators are created, and multiple independent iterators can traverse the same queue in different directions. Depends on Node.js EventEmitter. Not heavily maintained (last update years ago).
npm install queue.ioNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a queue from an EventEmitter, pushes values, then iterates forward consuming until done.
Use native async iteration with for-await-of or libraries like iter-ops.
Convert iterables to arrays first: Queue.from([...set]).
Always provide an eventEmitter or use Queue.from to avoid unexpected done.
Ensure you are using the default export: import Queue from 'queue.io' then call Queue() to create a queue.
Call iterate() only after the queue is done, or ensure events are listened after iterator creation.
Emit emitter.emit('done') after all values are pushed.