From 62132c42151e099be2513e36535ec75da535baf5 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sun, 15 Nov 2026 16:59:00 +0000 Subject: [PATCH 1/2] fs: move DEP0187 to End-of-Life Passing an invalid argument type to fs.existsSync() now throws ERR_INVALID_ARG_TYPE instead of returning false. Other invalid paths, such as strings containing null bytes or non-file: URLs, continue to return false. This has been a runtime deprecation since v24.0.0. Refs: https://github.com/nodejs/node/pull/55753 Refs: https://github.com/nodejs/node/pull/55892 Assisted-by: Claude Signed-off-by: James M Snell --- doc/api/deprecations.md | 9 ++++++--- doc/api/fs.md | 7 ++++++- lib/fs.js | 9 ++------- test/parallel/test-fs-exists.js | 12 +++++++----- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index fc333e937d6b..30ea2c5a8e53 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -4190,6 +4190,9 @@ npx codemod@latest @nodejs/repl-classes-with-new -Type: Runtime +Type: End-of-Life -Passing non-supported argument types is deprecated and, instead of returning `false`, -will throw an error in a future version. +Passing non-supported argument types to `fs.existsSync()` throws an +`ERR_INVALID_ARG_TYPE` error instead of returning `false`. ### DEP0188: `process.features.ipv6` and `process.features.uv` diff --git a/doc/api/fs.md b/doc/api/fs.md index 929ea3029576..c6fef435af32 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -6299,6 +6299,10 @@ behavior is similar to `cp dir1/ dir2/`.