createFile
codebolt.fs.createFile(fileName: string, source: string, filePath: string): Promise<CreateFileResponse>
Creates a new file with the specified content at the given path.
Parameters
Name | Type | Description |
---|---|---|
fileName | string | The name of the file to create. |
source | string | The source content to write into the file. |
filePath | string | The path where the file should be created. |
Returns:
Promise<CreateFileResponse>
A promise that resolves with the server response.Example
// Let's assume you want to create a file named example.txt in the /home/user/documents directory with some content.
codebolt.fs.createFile('example.txt', 'This is the content of the file.', '/home/user/documents');