Skip to content

Commit

Permalink
fs: undeprecate existsSync
Browse files Browse the repository at this point in the history
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
1 parent 19689e4 commit d255e0f
Showing 1 changed file with 4 additions and 7 deletions.
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

0 comments on commit d255e0f

Please sign in to comment.