File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2656,7 +2656,7 @@ changes:
26562656* `callback` {Function}
26572657 * `exists` {boolean}
26582658
2659- Test whether or not the given path exists by checking with the file system.
2659+ Test whether or not the element at the given ` path` exists by checking with the file system.
26602660Then call the `callback` argument with either true or false:
26612661
26622662```mjs
@@ -2673,6 +2673,9 @@ parameter, optionally followed by other parameters. The `fs.exists()` callback
26732673has only one boolean parameter. This is one reason `fs.access()` is recommended
26742674instead of `fs.exists()`.
26752675
2676+ If `path` is a symbolic link, it is followed. Thus, if `path` exists but points
2677+ to a non-existent element, the callback will receive the value `false`.
2678+
26762679Using `fs.exists()` to check for the existence of a file before calling
26772680`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing
26782681so introduces a race condition, since other processes may change the file's
You can’t perform that action at this time.
0 commit comments