updateFile
codebolt.fs.updateFile(filename: string, filePath: string, newContent: string): Promise<UpdateFileResponse>
Updates the content of a file at the specified path.
Parameters
Name | Type | Description |
---|---|---|
filename | string | The name of the file to update. |
filePath | string | The path of the file to update. |
newContent | string | The new content to write into the file. |
Returns:
Promise<UpdateFileResponse>
A promise that resolves with the server response.Example
// Let's assume you want to update the content of a file named example.txt in the /home/user/documents directory.
codebolt.fs.updateFile('example.txt', '/home/user/documents', 'This is the updated content.');