Skip to main content

updateFile

plugin.fs.updateFile(filename: string, filePath: string, newContent: string): Promise<UpdateFileResponse>

updateFile

Parameters

ParameterTypeRequiredDescription
filenamestringYesThe name of the file to update.
filePathstringYesThe path of the file to update.
newContentstringYesThe new content to write into the file.

Returns

Promise<UpdateFileResponse> — A promise that resolves with the server response.

Example

import plugin from '@codebolt/plugin-sdk';

const result = await plugin.fs.updateFile('filename', 'filePath', 'newContent');
console.log(result);