# copyFile

Copy a file.

```js
copyFile(source, destination)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `source` | string | Existing path. |
| `destination` | string | Destination path. |

## Returns

null on success; error string on failure.

## Example

```js
const error = copyFile(__dirname + "/input.txt", __dirname + "/output.txt");
if (error !== null) throw new Error(error);
```

[All JavaScript APIs](https://mcp.applesauceos.com/doc/api.md) · [Automation playbook](https://mcp.applesauceos.com/doc/ai.md)
