diff --git a/doc/api/events.md b/doc/api/events.md index c087c1a7c00273..1d5f673c33a9b8 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -1478,9 +1478,9 @@ require manual async tracking. Specifically, all events emitted by instances of `events.EventEmitterAsyncResource` will run within its [async context][]. ```mjs -import { EventEmitterAsyncResource } from 'node:events'; +import { EventEmitterAsyncResource, EventEmitter } from 'node:events'; import { notStrictEqual, strictEqual } from 'node:assert'; -import { executionAsyncId } from 'node:async_hooks'; +import { executionAsyncId, triggerAsyncId } from 'node:async_hooks'; // Async tracking tooling will identify this as 'Q'. const ee1 = new EventEmitterAsyncResource({ name: 'Q' }); @@ -1507,9 +1507,9 @@ Promise.resolve().then(() => { ``` ```cjs -const { EventEmitterAsyncResource } = require('node:events'); +const { EventEmitterAsyncResource, EventEmitter } = require('node:events'); const { notStrictEqual, strictEqual } = require('node:assert'); -const { executionAsyncId } = require('node:async_hooks'); +const { executionAsyncId, triggerAsyncId } = require('node:async_hooks'); // Async tracking tooling will identify this as 'Q'. const ee1 = new EventEmitterAsyncResource({ name: 'Q' });