diff options
Diffstat (limited to 'std/fs/expand_glob.ts')
-rw-r--r-- | std/fs/expand_glob.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/std/fs/expand_glob.ts b/std/fs/expand_glob.ts index 949f58f92..8a4b0ed03 100644 --- a/std/fs/expand_glob.ts +++ b/std/fs/expand_glob.ts @@ -62,6 +62,12 @@ function comparePath(a: WalkEntry, b: WalkEntry): number { /** * Expand the glob string from the specified `root` directory and yield each * result as a `WalkEntry` object. + * + * Examples: + * + * for await (const file of expandGlob("**\/*.ts")) { + * console.log(file); + * } */ export async function* expandGlob( glob: string, @@ -161,7 +167,15 @@ export async function* expandGlob( yield* currentMatches; } -/** Synchronous version of `expandGlob()`. */ +/** + * Synchronous version of `expandGlob()`. + * + * Examples: + * + * for (const file of expandGlobSync("**\/*.ts")) { + * console.log(file); + * } + */ export function* expandGlobSync( glob: string, { |