setMaxListeners
import { setMaxListeners, EventEmitter } from 'node:events';
const target = new EventTarget();
const emitter = new EventEmitter();
setMaxListeners(5, target, emitter);
Content copied to clipboard
Since
v15.4.0
Parameters
n
A non-negative number. The maximum number of listeners per EventTarget
event.
eventsTargets
Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, n
is set as the default max for all newly created {EventTarget} and {EventEmitter} objects.