Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fs: undeprecate existsSync
There's no alternative method to use that doesn't throw an exception
when the file doesn't exist.
  • Loading branch information
dfabulich committed Aug 16, 2016
commit d255e0fe6960dc6ae8401de13dc9898f9167c080
11 changes: 4 additions & 7 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,9 @@ deprecated: v1.0.0
* `path` {String | Buffer}
* `callback` {Function}

Test whether or not the given path exists by checking with the file system.
Then call the `callback` argument with either true or false. Example:
Test whether or not the given path exists and is accessible by checking
with the file system. Then call the `callback` argument with either
true or false. Example:

```js
fs.exists('/etc/passwd', (exists) => {
Expand All @@ -615,16 +616,12 @@ non-existent.
## fs.existsSync(path)
<!-- YAML
added: v0.1.21
deprecated: v1.0.0
-->

> Stability: 0 - Deprecated: Use [`fs.statSync()`][] or [`fs.accessSync()`][]
> instead.

* `path` {String | Buffer}

Synchronous version of [`fs.exists()`][].
Returns `true` if the file exists, `false` otherwise.
Returns `true` if the file exists and is accessible, `false` otherwise.

## fs.fchmod(fd, mode, callback)
<!-- YAML
Expand Down