diff --git a/doc/api/fs.md b/doc/api/fs.md index f1e2bcb60ab98a..50ab633b74d490 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1701,6 +1701,11 @@ this API: [`fs.exists()`][]. parameter to `fs.exists()` accepts parameters that are inconsistent with other Node.js callbacks. `fs.existsSync()` does not use a callback. +```js +if (fs.existsSync('/etc/passwd')) { + console.log('The file exists.'); +} +``` ## fs.fchmod(fd, mode, callback)