Skip to content

fix(deps): update dependency emittery to v2#52

Open
renovate[bot] wants to merge 1 commit into0.xfrom
renovate/emittery-2.x
Open

fix(deps): update dependency emittery to v2#52
renovate[bot] wants to merge 1 commit into0.xfrom
renovate/emittery-2.x

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 16, 2026

This PR contains the following updates:

Package Change Age Confidence
emittery ^1.2.0^2.0.0 age confidence

Release Notes

sindresorhus/emittery (emittery)

v2.0.0

Compare Source

Breaking Changes
Listeners now receive a unified {name, data} object instead of raw data

All listeners (.on(), .onAny(), .once(), async iterators) now receive a single event object with name and data properties instead of the raw event data.

- emitter.on('🦄', data => {
-   console.log(data);
+ emitter.on('🦄', ({data}) => {
+   console.log(data);
  });

For .onAny():

- emitter.onAny((eventName, eventData) => {
-   console.log(eventName, eventData);
+ emitter.onAny(({name, data}) => {
+   console.log(name, data);
  });

For .once():

- const data = await emitter.once('🦄');
+ const {data} = await emitter.once('🦄');

For .events() and .anyEvent() async iterators:

- for await (const data of emitter.events('🦄')) {
+ for await (const {data} of emitter.events('🦄')) {
    console.log(data);
  }

- for await (const [eventName, eventData] of emitter.anyEvent()) {
+ for await (const {name, data} of emitter.anyEvent()) {
    …
  }

For predicates in .once():

- emitter.once('data', data => data.ok === true);
+ emitter.once('data', ({data}) => data.ok === true);
emit() now throws AggregateError instead of rejecting with a single error

When multiple listeners throw, emit() now collects all errors into an AggregateError instead of silently dropping errors after the first one. All listeners always run to completion.

  try {
    await emitter.emit('event');
  } catch (error) {
-   // error was from the first listener that threw
+   // error is an AggregateError with all listener errors in error.errors
+   console.log(error.errors);
  }
Requires Node.js 22

The minimum required Node.js version is now 22 (previously 14.16).

New Features
  • init/deinit lifecycle hooks - Register setup/teardown logic that runs when the first listener subscribes and the last listener unsubscribes for a given event.
  • Disposable support - Unsubscribe functions from .on() and .onAny() are now Disposable (usable with using for automatic cleanup).
  • AsyncDisposable support - Async iterators from .events() and .anyEvent() are now AsyncDisposable (usable with await using).
  • AbortSignal support for .events(), .anyEvent(), and .once() - Pass {signal} to cancel subscriptions externally.
  • .once() options object - Accepts {predicate, signal} in addition to a plain predicate function.
  • TC39 standard decorator support - Emittery.mixin() now works with both legacy and TC39 standard decorator syntax.
Bug Fixes
  • emit() no longer silently drops errors from multiple listeners
  • Debug logger no longer emits noise for internal meta events
  • Fixed emitMetaEvent breaking async emit() overrides in subclasses
  • Fixed Emittery not working when wrapped in a Proxy
  • Fixed mixin decorator to work with TC39 standard decorator syntax

v1.2.1

Compare Source

  • Fix emitSerial() not delivering events to async iterators a3c04ca


Configuration

📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants