![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/metras.v32.1/node_modules/fs-extra/docs/ |
# pathExists(file[, callback]) Test whether or not the given path exists by checking with the file system. Like [`fs.exists`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback), but with a normal callback signature (err, exists). Uses `fs.access` under the hood. - `file` `<String>` - `callback` `<Function>` ## Example: ```js const fs = require('fs-extra') const file = '/tmp/this/path/does/not/exist/file.txt' // Promise usage: fs.pathExists(file) .then(exists => console.log(exists)) // => false // Callback usage: fs.pathExists(file, (err, exists) => { console.log(err) // => null console.log(exists) // => false }) ```