Emittery is a simple, modern async event emitter for Node.js and the browser, designed so listeners run asynchronously (next microtask) to keep code non-blocking. It supports strongly typed events (TypeScript), async iteration with for await...of, cancellation via AbortSignal, lifecycle hooks (init and deinit), and debug logging. Useful for building event-driven code that needs Promise-based async behavior and clean subscription management.
Project status
- Actively maintained: Yes, the repo shows recent work within the last year (latest upstream push on 2026-05-24, and tagged updates through 2026-03-04).
- Update cadence: Updates are somewhat bursty, with a major change on 2026-03-04, then smaller updates in early 2026 (2026-02-27 and 2026-03-04), followed by a longer quiet period until the latest upstream push in May 2026.
AI summary generated
Recent updates
v2.0.0
v2.0.0 is a major release that changes the listener callback API to receive a unified event object ({name, data}) instead of raw event data. It also changes error propagation semantics for emit to throw an AggregateError when multiple listeners fail, and raises the minimum Node.js requirement to 22. The release adds lifecycle hooks (init/deinit) and improves ergonomics with Disposable/AsyncDisposable, AbortSignal-based cancellation, and enhanced TypeScript/decorator support.
BreakingFeaturesv1.2.1
v1.2.1 focuses on fixing emitSerial so events are properly delivered to async iterators. The code change also adjusts how any-event listeners are collected for meta events, which is not mentioned in the release notes.
v1.2.0
This release adds optional support for a filter predicate to Emittery's `once()` API. When the predicate is provided, the listener only resolves after the first emitted event whose payload satisfies the predicate, and the unsubscribe happens at that time.
Featuresv1.1.0
Release v1.1.0 adds support for using an AbortController signal to automatically unsubscribe listeners added via `on` and `onAny`. When the provided `AbortSignal` aborts, the listener is removed and further emits will not invoke it.
Featuresv1.0.3
v1.0.3 is presented as a compatibility fix for the `p-event` package. The changes in this diff are limited to TypeScript typing tests and the `p-event` development dependency.
v1.0.2
This release (v1.0.2) addresses an issue with `emitter.listenerCount()` when the `eventName` is a symbol key. The code changes introduce a shared `isEventKeyType` helper and add/adjust type checks in `listenerCount` (and related internal helpers) to ensure symbol keys are handled correctly.
v1.0.1
Release v1.0.1 contains a small hotfix focused on browser environments where a `globalThis.process` global can conflict with DOM elements. The code changes also adjust several internal nullish handling patterns for debug configuration and listener/producers counting.
v1.0.0
v1.0.0 makes Emittery a pure ESM package and updates the minimum supported Node.js version. The TypeScript surface area was adjusted so some types that were previously accessed from the `Emittery.` namespace are now available as named exports.
Breakingv0.13.1
Release v0.13.1 updates the published package contents to include a missing file. The only code-related change in the diff is in package.json, where the file list for the npm package is adjusted.
v0.13.0
v0.13.0 is described as an internal cleanup focused on properly removing listener storage. The diff shows changes to how internal WeakMaps track event listeners and event producers, with additional logic to avoid retaining empty Sets for events that no longer have listeners/producers.