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

# edit

**.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](https://pondwadermc.gitbook.io/cubed-api/tutorials-and-guides/sessions)
{% endhint %}
