From e6c4357c8f89c6f703e3df97cc35993208fac030 Mon Sep 17 00:00:00 2001 From: Arham Wani Date: Mon, 10 Aug 2026 05:01:23 +0530 Subject: [PATCH] doc: fix fs.watch overflow option accepted value The `overflow` option for `fs.watch()` and `fsPromises.watch()` is documented as accepting `'ignore'` or `'throw'`, but the implementation validates against `['ignore', 'error']` in lib/internal/fs/watchers.js. Passing the documented `'throw'` value therefore throws `ERR_INVALID_ARG_VALUE`. Update the documentation to use `'error'`, the value that is actually accepted. Signed-off-by: Arham Wani --- doc/api/fs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 21eaa6af0e1c..5452084a15c2 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2216,9 +2216,9 @@ added: should stop. * `maxQueue` {number} Specifies the number of events to queue between iterations of the {AsyncIterator} returned. **Default:** `2048`. - * `overflow` {string} Either `'ignore'` or `'throw'` when there are more events to be + * `overflow` {string} Either `'ignore'` or `'error'` when there are more events to be queued than `maxQueue` allows. `'ignore'` means overflow events are dropped and a - warning is emitted, while `'throw'` means to throw an exception. **Default:** `'ignore'`. + warning is emitted, while `'error'` means to throw an exception. **Default:** `'ignore'`. * `ignore` {string|RegExp|Function|Array} Pattern(s) to ignore. Strings are glob patterns (using [`minimatch`][]), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to