Skip to content

MaxListenersExceededWarning and EventTarget #36423

Answered by jasnell
noseratio asked this question in General
Discussion options

You must be logged in to vote

See: https://nodejs.org/dist/latest-v15.x/docs/api/events.html#events_eventemitter_setmaxlisteners_n_eventtargets

const {
  setMaxListeners,
  EventEmitter
} = require('events');

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

setMaxListeners(5, target, emitter);

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@noseratio
Comment options

Answer selected by noseratio
Comment options

You must be logged in to vote
2 replies
@fawazahmed0
Comment options

@newTomas
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants