Hide MaxListenersExceededWarning warnings of Node.js
Jul 22, 2024/
#nodejs
/-1 minWhen working with Node.js, you must have come across the following warning.
You can increase the limit to get rid of this warning. But keep in mind that this can create a memory leak. Don't use it to sweep under the rug! I used it to hide logs that show up in cli tool.
1import events from 'events';
2events.EventEmitter.prototype.setMaxListeners(30);