★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/818f08416cNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
doc: add example code for fs.existsSync()
PR-URL: #28354
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
nicolasrestrepo authored and targos committed Jul 2, 2019
1 parent 5047006 commit 818f08416c456a33173bfad25d81b00fd0c842f0
Showing with 5 additions and 0 deletions.
  1. +5 −0 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)
<!-- YAML

0 comments on commit 818f084

Please sign in to comment.