From d77ed7854e74e7d8b0771e3c67e302b68614fe4a Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 18 Nov 2026 04:02:29 -0800 Subject: [PATCH] fs: move DEP0187 to End-of-Life MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 PR-URL: https://github.com/nodejs/node/pull/67494 Reviewed-By: Matteo Collina Reviewed-By: Gürgün Dayıoğlu Reviewed-By: LiviaMedeiros Reviewed-By: Richard Lau --- 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 77bd1a743d0..2837a08697f 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -4207,6 +4207,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 929ea302957..186ab76c098 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -6299,6 +6299,10 @@ behavior is similar to `cp dir1/ dir2/`.