searchFiles
codebolt.fs.searchFiles(path: string, regex: string, filePattern: string): Promise<SearchFilesResponse>
Searches files in a given path using a regex pattern.
Parameters
Name | Type | Description |
---|---|---|
path | string | The path to search within. |
regex | string | The regex pattern to search for. |
filePattern | string | The file pattern to match files. |
Returns:
Promise<SearchFilesResponse>
A promise that resolves with the search results.Example
// Let's assume you want to search for files in the /home/user/documents directory that match the regex pattern "example" and have a .txt extension.
codebolt.fs.searchFiles('/home/user/documents', 'example', '*.txt');