Go to Latest
function setMaxListeners
import { setMaxListeners } from "https://deno.land/std@0.158.0/node/events.ts";

n {number} A non-negative number. The maximum number of listeners per EventTarget event. ...eventsTargets {EventTarget[]|EventEmitter[]} 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.

import { setMaxListeners, EventEmitter } from 'node:events';

const target = new EventTarget();
const emitter = new EventEmitter();

setMaxListeners(5, target, emitter);
const {
  setMaxListeners,
  EventEmitter
} = require('node:events');

const target = new EventTarget();
const emitter = new EventEmitter();

setMaxListeners(5, target, emitter);

Parameters

n: number