Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: suggest alternatives to deprecated APIs #1007

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
12 changes: 9 additions & 3 deletions doc/api/fs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,10 @@ callback, and have some fallback logic if it is null.

## fs.exists(path, callback)

`fs.exists()` is **deprecated**. For supported alternatives please check out
[`fs.stat`](fs.html#fs_fs_stat_path_callback) or
[`fs.access`](fs.html#fs_fs_access_path_mode_callback).

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:

Expand All @@ -657,13 +661,15 @@ that leaves you vulnerable to race conditions: another process may remove the
file between the calls to `fs.exists()` and `fs.open()`. Just open the file
and handle the error when it's not there.

`fs.exists()` is **deprecated**.


## fs.existsSync(path)

Synchronous version of `fs.exists`.
Synchronous version of [`fs.exists`](fs.html#fs_fs_exists_path_callback).

`fs.existsSync()` is **deprecated**.
`fs.existsSync()` is **deprecated**. For supported alternatives please check
out [`fs.statSync`](fs.html#fs_fs_statsync_path) or
[`fs.accessSync`](fs.html#fs_fs_accesssync_path_mode).

## fs.access(path[, mode], callback)

Expand Down