File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2736,7 +2736,7 @@ changes:
2736
2736
* `callback` {Function}
2737
2737
* `exists` {boolean}
2738
2738
2739
- Test whether or not the given path exists by checking with the file system.
2739
+ Test whether or not the element at the given ` path` exists by checking with the file system.
2740
2740
Then call the `callback` argument with either true or false:
2741
2741
2742
2742
```mjs
@@ -2753,6 +2753,9 @@ parameter, optionally followed by other parameters. The `fs.exists()` callback
2753
2753
has only one boolean parameter. This is one reason `fs.access()` is recommended
2754
2754
instead of `fs.exists()`.
2755
2755
2756
+ If `path` is a symbolic link, it is followed. Thus, if `path` exists but points
2757
+ to a non-existent element, the callback will receive the value `false`.
2758
+
2756
2759
Using `fs.exists()` to check for the existence of a file before calling
2757
2760
`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing
2758
2761
so introduces a race condition, since other processes may change the file's
You can’t perform that action at this time.
0 commit comments