From d255e0fe6960dc6ae8401de13dc9898f9167c080 Mon Sep 17 00:00:00 2001 From: Dan Fabulich Date: Mon, 27 Jun 2016 22:31:20 -0700 Subject: [PATCH] fs: undeprecate existsSync There's no alternative method to use that doesn't throw an exception when the file doesn't exist. --- doc/api/fs.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 40b8a990631271..3cac285dec7903 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -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) => { @@ -615,16 +616,12 @@ non-existent. ## fs.existsSync(path) -> 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)