# listDir

List names in a directory.

```js
listDir(path)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `path` | string | Directory 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](https://mcp.applesauceos.com/doc/api.md) · [Automation playbook](https://mcp.applesauceos.com/doc/ai.md)
