From 0dbba4e9d8adebe6628e7b87cb13d74950355e8a Mon Sep 17 00:00:00 2001 From: mukunda katta Date: Fri, 15 May 2026 13:11:30 -0700 Subject: [PATCH] doc: clarify fs string paths are not URLs --- doc/api/fs.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index c5e908aaa39f6c..b66cb832e0a23a 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -8707,8 +8707,11 @@ a string, a {Buffer}, or a {URL} object using the `file:` protocol. #### String paths String paths are interpreted as UTF-8 character sequences identifying -the absolute or relative filename. Relative paths will be resolved relative -to the current working directory as determined by calling `process.cwd()`. +an absolute or relative path. Relative paths will be resolved relative to the +current working directory as determined by calling `process.cwd()`. + +A string path is not interpreted as a URL, even if it starts with `file:`. +To pass a `file:` URL, use a {URL} object. Example using an absolute path on POSIX: