Skip to main content

writeToFile

plugin.fs.writeToFile(relPath: string, newContent: string): Promise<any>

writeToFile

Parameters

ParameterTypeRequiredDescription
relPathstringYesThe relative path of the file to write to.
newContentstringYesThe new content to write into the file.

Returns

Promise<any> — A promise that resolves with the write operation result.

Example

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

const result = await plugin.fs.writeToFile('relPath', 'newContent');
console.log(result);