# 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:292](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L292) ## Properties ### `ERRNO_CODES` > > `Private` **`ERRNO_CODES`**: `any` #### Defined in [packages/contents/src/drivefs.ts:466](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L466) ### `FS` > > `Private` **`FS`**: [`FS`](../modules/jupyterlite_contents.md#fs) #### Defined in [packages/contents/src/drivefs.ts:465](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L465) ### `_baseUrl` > > `Private` **`_baseUrl`**: `string` #### Defined in [packages/contents/src/drivefs.ts:462](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L462) ### `_driveName` > > `Private` **`_driveName`**: `string` #### Defined in [packages/contents/src/drivefs.ts:463](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L463) ### `_mountpoint` > > `Private` **`_mountpoint`**: `string` #### Defined in [packages/contents/src/drivefs.ts:464](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L464) ## Accessors ### `endpoint` > > `get` **`endpoint`**(): `string` Get the api/drive endpoint #### Returns `string` #### Defined in [packages/contents/src/drivefs.ts:458](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L458) ## 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:363](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L363) ### `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:422](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L422) ### `getmode` > > **`getmode`**(`path`): `number` #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns `number` #### Defined in [packages/contents/src/drivefs.ts:327](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L327) ### `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:323](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L323) ### `mknod` > > **`mknod`**(`path`, `mode`): `any` #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | | `mode` | `number` | #### Returns `any` #### Defined in [packages/contents/src/drivefs.ts:333](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L333) ### `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:441](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L441) ### `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:393](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L393) ### `readdir` > > **`readdir`**(`path`): `string`[] #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns `string`[] #### Defined in [packages/contents/src/drivefs.ts:349](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L349) ### `rename` > > **`rename`**(`oldPath`, `newPath`): `void` #### Parameters | Name | Type | | :------ | :------ | | `oldPath` | `string` | | `newPath` | `string` | #### Returns `void` #### Defined in [packages/contents/src/drivefs.ts:341](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L341) ### `request` > > **`request`**(`data`): `any` #### Parameters | Name | Type | | :------ | :------ | | `data` | [`IDriveRequest`](../interfaces/jupyterlite_contents.IDriveRequest.md) | #### Returns `any` #### Defined in [packages/contents/src/drivefs.ts:306](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L306) ### `rmdir` > > **`rmdir`**(`path`): `void` #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns `void` #### Defined in [packages/contents/src/drivefs.ts:359](https://github.com/jupyterlite/jupyterlite/blob/c78cc8d/packages/contents/src/drivefs.ts#L359)