ApplesauceOS
Read Markdown ↗Download .md

listDir

List names in a directory.

js
listDir(path)

Arguments

ArgumentTypeMeaning
pathstringDirectory path.

Returns

Array of filenames; [] for an empty directory or failure.

Example

js
console.log(listDir(__dirname));

Notes

Native file helpers do not resolve relative paths like require(); use __dirname or scriptsDir().

All JavaScript APIs · Automation playbook