Skip to content

Commit 0dbba4e

Browse files
committed
doc: clarify fs string paths are not URLs
1 parent e568673 commit 0dbba4e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

doc/api/fs.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8707,8 +8707,11 @@ a string, a {Buffer}, or a {URL} object using the `file:` protocol.
87078707
#### String paths
87088708
87098709
String paths are interpreted as UTF-8 character sequences identifying
8710-
the absolute or relative filename. Relative paths will be resolved relative
8711-
to the current working directory as determined by calling `process.cwd()`.
8710+
an absolute or relative path. Relative paths will be resolved relative to the
8711+
current working directory as determined by calling `process.cwd()`.
8712+
8713+
A string path is not interpreted as a URL, even if it starts with `file:`.
8714+
To pass a `file:` URL, use a {URL} object.
87128715
87138716
Example using an absolute path on POSIX:
87148717

0 commit comments

Comments
 (0)