> For the complete documentation index, see [llms.txt](https://pondwadermc.gitbook.io/cubed-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pondwadermc.gitbook.io/cubed-api/documentation/files/edit.md).

# edit

.edit() is used to edit the contents of a file in the file manager

**.edit(SessionID, path, newContent)**

Delete a file or folder in a servers file manager.

| Parameter  | Type   | Required | Description                                            |
| ---------- | ------ | -------- | ------------------------------------------------------ |
| SessionID  | string | true     | The session ID that you want to perform this action on |
| path       | string | true     | The path of the file you wish to edit                  |
| newContent | string | true     | The new content to place in the file                   |

**Example:**

```javascript
// Dependencies
const CubedCraft = require('cubed-api');

// Editing the file
CubedCraft.files.edit('SessionID', '/plugins/Skript/scripts/decentskript.sk', 'on load:\n  broadcast "loaded"');
```

{% hint style="info" %}
Read the guide on session IDs: <https://pondwadermc.gitbook.io/cubed-api/tutorials-and-guides/sessions>
{% endhint %}
