diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2020-06-21 03:34:28 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-20 14:34:28 -0400 |
commit | c0ea9a99c0dc21faf46f73dca481361853e914fa (patch) | |
tree | 4c6f9c0dc4e2b75b220eb1a701a2c84c96a826d9 /std/fs/README.md | |
parent | 3c58767831f87656857bd9decf29b29aac0dfb16 (diff) |
docs: document and add examples of expandGlob (#6404)
Diffstat (limited to 'std/fs/README.md')
-rw-r--r-- | std/fs/README.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/std/fs/README.md b/std/fs/README.md index e0f0d85ce..612b1393f 100644 --- a/std/fs/README.md +++ b/std/fs/README.md @@ -196,3 +196,28 @@ import { writeFileStr("./target.dat", "file content"); // returns a promise writeFileStrSync("./target.dat", "file content"); // void ``` + +### expandGlob + +Expand the glob string from the specified `root` directory and yield each result +as a `WalkEntry` object. + +```ts +import { expandGlob } from "https://deno.land/std/fs/mod.ts"; + +for await (const file of expandGlob("**/*.ts")) { + console.log(file); +} +``` + +### expandGlobSync + +Synchronous version of `expandGlob()`. + +```ts +import { expandGlobSync } from "https://deno.land/std/fs/mod.ts"; + +for (const file of expandGlobSync("**/*.ts")) { + console.log(file); +} +``` |