diff --git a/doc/api/events.md b/doc/api/events.md index cb301bd5b36427..ff6b412cf4282b 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -232,10 +232,10 @@ Setting `events.captureRejections = true` will change the default for all new instances of `EventEmitter`. ```mjs -import * as events from 'node:events'; +import { EventEmitter } from 'node:events'; -events.captureRejections = true; -const ee1 = new events.EventEmitter(); +EventEmitter.captureRejections = true; +const ee1 = new EventEmitter(); ee1.on('something', async (value) => { throw new Error('kaboom'); });