Skip to main content

Function: findFilesRecursivelyStringStartsWith()

findFilesRecursivelyStringStartsWith(path: PathLike, fileStartsWith: string): AsyncIterableIterator<string>

Parameters

ParameterTypeDescription
pathPathLikeThe path in which to find files. This can be a string, buffer, or URL.
fileStartsWithstring

The string pattern with which the file name must start.

Note that we do not support a full globby pattern using asterisk for wildcards. It has to be an exact match with String.startsWith

Returns

AsyncIterableIterator<string>

An AsyncIterableIterator of all the files. To loop over these use for await (const file of findFilesRecursivelyStringStartsWith(path, fileNameEndsWith)) {}

Source

lib/findFilesRecursively.ts:51