Skip to main content

listFile

codebolt.fs.listFile(folderPath: string, isRecursive: boolean): Promise<FileListResponse>
Lists all files in a specified directory.

Parameters

NameTypeDescription
folderPathstringThe path of the directory to list files from.
isRecursivebooleanWhether 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');