From 2b844ed1fc1adb082fbf641aa54e5945ca39ef65 Mon Sep 17 00:00:00 2001 From: atlowChemi Date: Thu, 14 Mar 2024 10:02:46 +0200 Subject: [PATCH] doc: document missing options of events.on Fixes: https://github.com/nodejs/node/issues/52078 Refs: https://github.com/nodejs/node/pull/41276 --- doc/api/events.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/events.md b/doc/api/events.md index 872ebfd6179d4e..27a0c6b0597279 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -1661,12 +1661,27 @@ console.log(listenerCount(myEmitter, 'event')); added: - v13.6.0 - v12.16.0 +changes: + - version: + - v20.0.0 + pr-url: https://github.com/nodejs/node/pull/41276 + description: The `close`, `highWaterMark`, and `lowWaterMark` + options are supported now. --> * `emitter` {EventEmitter} * `eventName` {string|symbol} The name of the event being listened for * `options` {Object} * `signal` {AbortSignal} Can be used to cancel awaiting events. + * `close` - {string\[]} Event names that will end the iteration. + * `highWaterMark` - {integer} **Default:** `Number.MAX_SAFE_INTEGER` + The high watermark. The emitter is paused every time size of events being + buffered is higher than it. Supported only on emitters implementing + `pause()` and `resume()` methods. + * `lowWaterMark` - {integer} **Default:** `1` + The low watermark. The emitter is resumed every time size of events being + buffered is lower than it. Supported only on emitters implementing + `pause()` and `resume()` methods. * Returns: {AsyncIterator} that iterates `eventName` events emitted by the `emitter` ```mjs