+<div class="tsd-signature"><span class="tsd-kind-property">default<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
+<div class="tsd-comment tsd-typography"><p>By default, a maximum of <code>10</code> listeners can be registered for any single
+event. This limit can be changed for individual <code>EventEmitter</code> instances
+using the <code>emitter.setMaxListeners(n)</code> method. To change the default
+for <em>all</em><code>EventEmitter</code> instances, the <code>events.defaultMaxListeners</code>property can be used. If this value is not a positive number, a <code>RangeError</code>is thrown.</p>
+<p>Take caution when setting the <code>events.defaultMaxListeners</code> because the
+change affects <em>all</em><code>EventEmitter</code> instances, including those created before
+the change is made. However, calling <code>emitter.setMaxListeners(n)</code> still has
+precedence over <code>events.defaultMaxListeners</code>.</p>
+<p>This is not a hard limit. The <code>EventEmitter</code> instance will allow
+more listeners to be added but will output a trace warning to stderr indicating
+that a "possible EventEmitter memory leak" has been detected. For any single<code>EventEmitter</code>, the <code>emitter.getMaxListeners()</code> and <code>emitter.setMaxListeners()</code>methods can be used to
+temporarily avoid this warning:</p>
+<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">'node:events'</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">emitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">getMaxListeners</span><span class="hl-0">() + </span><span class="hl-1">1</span><span class="hl-0">);</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">'event'</span><span class="hl-0">, () </span><span class="hl-4">=></span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-8">// do stuff</span><br/><span class="hl-0"> </span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-3">Math</span><span class="hl-0">.</span><span class="hl-2">max</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">getMaxListeners</span><span class="hl-0">() - </span><span class="hl-1">1</span><span class="hl-0">, </span><span class="hl-1">0</span><span class="hl-0">));</span><br/><span class="hl-0">});</span>
+</code><button>Copy</button></pre>
+<p>The <code>--trace-warnings</code> command-line flag can be used to display the
+stack trace for such warnings.</p>
+<p>The emitted warning can be inspected with <code>process.on('warning')</code> and will
+have the additional <code>emitter</code>, <code>type</code>, and <code>count</code> properties, referring to
+the event emitter instance, the event's name and the number of attached
+listeners, respectively.
+Its <code>name</code> property is set to <code>'MaxListenersExceededWarning'</code>.</p>
+
+<h3>Since</h3><p>v0.11.2</p>
+</div><aside class="tsd-sources">
+<p>Inherited from EventEmitterAsyncResource.defaultMaxListeners</p>