moveFile
Move or rename a path.
js
moveFile(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 = moveFile(__dirname + "/input.txt", __dirname + "/output.txt");
if (error !== null) throw new Error(error);