---
title: "createDirectory"
source: "https://browserpod.io/docs/reference/BrowserPod/createDirectory"
---

# createDirectory

Create a directory in the Pod's filesystem

```ts
class BrowserPod {
  async createDirectory(
    path: string,
    opts?: { recursive?: boolean }
  ): Promise<void>;
}
```

## Parameters

- **path (`string`)** - Path of the newly-created directory.
- **opts (`object`, __optional__)** - Creation options passed as an object.

## Options

- **recursive (`boolean`, _optional_)** - Wether missing intermediate directory should be created or not.

## Returns

`createDirectory` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which is resolved when the operation has succeeded. If the directory could not be created, the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) will be rejected.
