# path.getDirectory

Function · category: Other

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/core/path.js#L127

```ts
getDirectory(pathname: string): string
```

Get the directory name from the path. This is everything up to the final instance of
[path.delimiter](https://api.playcanvas.com/engine/variables/path.delimiter.md).

**Parameters**

- `pathname` (`string`): The path to get the directory from.

**Returns** `string`: The directory part of the path.
