ApplesauceOS
Read Markdown ↗Download .md

fileExists

Check whether a path exists.

js
fileExists(path)

Arguments

ArgumentTypeMeaning
pathstringFile 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().

All JavaScript APIs · Automation playbook