Queue events from an event emitter until a listener is attached. Version 1.0.0 is the latest stable release. This module allows emitting events before any listener is registered, queuing them until a matching 'on' handler is added. Works with Node.js EventEmitter and the component/emitter library. Useful for initialization sequences where events fire before listeners are set up. Minimal API with a single method 'queue'.
npm install emitter-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a queue-enabled emitter, queue events before a listener is attached, and then attach a listener to receive queued events.
Ensure you call queue(emitter) on the emitter instance before calling emitter.queue().
Always attach a listener via emitter.on() or emitter.once() to receive queued events, or ensure events are emitted after listeners are attached.
Use consistent event name casing.
const queue = require('emitter-queue'); queue(emitter);Run 'npm install emitter-queue' and use require('emitter-queue').No dependency data recorded yet.