# Class: `ContentsAPI` [@jupyterlite/contents](../modules/jupyterlite_contents.md).ContentsAPI Wrap ServiceWorker requests for an Emscripten-compatible synchronous API. ## Constructors ### `constructor` > **`new ContentsAPI`**(`baseUrl`, `driveName`, `mountpoint`, `FS`, `ERRNO_CODES`) #### Parameters | Name | Type | | :------------ | :-------------------------------------------- | | `baseUrl` | `string` | | `driveName` | `string` | | `mountpoint` | `string` | | `FS` | [`FS`](../modules/jupyterlite_contents.md#fs) | | `ERRNO_CODES` | `any` | #### Defined in [packages/contents/src/drivefs.ts:287](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L287) ## Properties ### `ERRNO_CODES` > `Private` **`ERRNO_CODES`**: `any` #### Defined in [packages/contents/src/drivefs.ts:461](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L461) ### `FS` > `Private` **`FS`**: [`FS`](../modules/jupyterlite_contents.md#fs) #### Defined in [packages/contents/src/drivefs.ts:460](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L460) ### `_baseUrl` > `Private` **`_baseUrl`**: `string` #### Defined in [packages/contents/src/drivefs.ts:457](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L457) ### `_driveName` > `Private` **`_driveName`**: `string` #### Defined in [packages/contents/src/drivefs.ts:458](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L458) ### `_mountpoint` > `Private` **`_mountpoint`**: `string` #### Defined in [packages/contents/src/drivefs.ts:459](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L459) ## Accessors ### `endpoint` > `get` **`endpoint`**(): `string` Get the api/drive endpoint #### Returns `string` #### Defined in [packages/contents/src/drivefs.ts:453](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L453) ## Methods ### `get` > **`get`**(`path`): [`IFile`](../interfaces/jupyterlite_contents.DriveFS.IFile.md) #### Parameters | Name | Type | | :----- | :------- | | `path` | `string` | #### Returns [`IFile`](../interfaces/jupyterlite_contents.DriveFS.IFile.md) #### Defined in [packages/contents/src/drivefs.ts:358](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L358) ### `getattr` > **`getattr`**(`path`): [`IStats`](../interfaces/jupyterlite_contents.IStats.md) #### Parameters | Name | Type | | :----- | :------- | | `path` | `string` | #### Returns [`IStats`](../interfaces/jupyterlite_contents.IStats.md) #### Defined in [packages/contents/src/drivefs.ts:417](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L417) ### `getmode` > **`getmode`**(`path`): `number` #### Parameters | Name | Type | | :----- | :------- | | `path` | `string` | #### Returns `number` #### Defined in [packages/contents/src/drivefs.ts:322](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L322) ### `lookup` > **`lookup`**(`path`): > [`ILookup`](../interfaces/jupyterlite_contents.DriveFS.ILookup.md) #### Parameters | Name | Type | | :----- | :------- | | `path` | `string` | #### Returns [`ILookup`](../interfaces/jupyterlite_contents.DriveFS.ILookup.md) #### Defined in [packages/contents/src/drivefs.ts:318](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L318) ### `mknod` > **`mknod`**(`path`, `mode`): `any` #### Parameters | Name | Type | | :----- | :------- | | `path` | `string` | | `mode` | `number` | #### Returns `any` #### Defined in [packages/contents/src/drivefs.ts:328](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L328) ### `normalizePath` > **`normalizePath`**(`path`): `string` Normalize a Path by making it compliant for the content manager #### Parameters | Name | Type | | :----- | :------- | | `path` | `string` | #### Returns `string` #### Defined in [packages/contents/src/drivefs.ts:436](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L436) ### `put` > **`put`**(`path`, `value`): `any` #### Parameters | Name | Type | | :------ | :------------------------------------------------------------- | | `path` | `string` | | `value` | [`IFile`](../interfaces/jupyterlite_contents.DriveFS.IFile.md) | #### Returns `any` #### Defined in [packages/contents/src/drivefs.ts:388](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L388) ### `readdir` > **`readdir`**(`path`): `string`[] #### Parameters | Name | Type | | :----- | :------- | | `path` | `string` | #### Returns `string`[] #### Defined in [packages/contents/src/drivefs.ts:344](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L344) ### `rename` > **`rename`**(`oldPath`, `newPath`): `void` #### Parameters | Name | Type | | :-------- | :------- | | `oldPath` | `string` | | `newPath` | `string` | #### Returns `void` #### Defined in [packages/contents/src/drivefs.ts:336](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L336) ### `request` > **`request`**(`data`): `any` #### Parameters | Name | Type | | :----- | :--------------------------------------------------------------------- | | `data` | [`IDriveRequest`](../interfaces/jupyterlite_contents.IDriveRequest.md) | #### Returns `any` #### Defined in [packages/contents/src/drivefs.ts:301](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L301) ### `rmdir` > **`rmdir`**(`path`): `void` #### Parameters | Name | Type | | :----- | :------- | | `path` | `string` | #### Returns `void` #### Defined in [packages/contents/src/drivefs.ts:354](https://github.com/jupyterlite/jupyterlite/blob/7971e0aa/packages/contents/src/drivefs.ts#L354)