fileExists
Check whether a path exists.
js
fileExists(path)Arguments
| Argument | Type | Meaning |
|---|---|---|
path | string | File or directory path. |
Returns
Boolean.
Example
js
console.log(fileExists(__dirname + "/config.json"));Notes
Native file helpers do not resolve relative paths like require(); use __dirname or scriptsDir().