readFile
codebolt.fs.readFile(filePath: string): Promise<ReadFileResponse>
Reads the content of a file from the specified path.
Parameters
Name | Type | Description |
---|---|---|
filePath | string | The path of the file to read. |
Returns:
Promise<ReadFileResponse>
A promise that resolves with the server response.Example
// Let's assume you want to read the content of a file named example.txt in the /home/user/documents directory.
codebolt.fs.readFile('/home/user/documents/example.txt');