Skip to main content

createFile

plugin.fs.createFile(fileName: string, source: string, filePath: string): Promise<CreateFileResponse>

createFile

Parameters

ParameterTypeRequiredDescription
fileNamestringYesThe name of the file to create.
sourcestringYesThe source content to write into the file.
filePathstringYesThe path where the file should be created.

Returns

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

Example

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

const result = await plugin.fs.createFile('fileName', 'source', 'filePath');
console.log(result);