listFile
codebolt.fs.listFile(folderPath: string, isRecursive: boolean): Promise<FileListResponse>
Lists all files in a specified directory.
Parameters
Name | Type | Description |
---|---|---|
folderPath | string | The path of the directory to list files from. |
isRecursive | boolean | Whether to list files recursively. |
Returns:
Promise<FileListResponse>
A promise that resolves with the list of files.Example
// Let's assume you want to list all files in the /home/user/documents directory.
codebolt.fs.listFile('/home/user/documents');