A simple EventEmitter that runs each event handler in a queue, ensuring sequential execution of asynchronous handlers. Version 2.1.1 is stable and uses a Promise-based queue with optional concurrency control. Unlike standard EventEmitter (which fires listeners concurrently), QueueEventEmitter guarantees that handlers for the same event type execute one after another (or with a configurable concurrency limit). This prevents race conditions and ensures predictable ordering of async event processing. The package is lightweight, has no dependencies, and is ideal for workflows where order and sequential execution matter (e.g., database writes, API calls). Maintained with infrequent releases.
npm install queue-event-emitterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: create a queue event emitter, add an async handler, and emit events that run sequentially.
Use standard EventEmitter if you need those events, or implement a workaround.
Always return a Promise from handlers, or use async functions.
Always attach an 'error' handler to avoid silent failures.
Replace any code that depends on the return value of emit (e.g., if (emitter.emit(...))). Use 'listenerCount' instead.
Use const QueueEventEmitter = require('queue-event-emitter'); or import QueueEventEmitter from 'queue-event-emitter';Add emitter.on('error', (err) => console.error(err));Run npm install queue-event-emitter, then require correctly.
No dependency data recorded yet.