summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2021-04-28 21:37:16 +0900
committerGitHub <noreply@github.com>2021-04-28 21:37:16 +0900
commit8c6f97719215815eae63cfb7cdcb5def27756a3a (patch)
tree243f147c103908f33bbc9365c4fe682fa4946fec
parent3a03084580188f53d348dc687aea83b2e6f1a851 (diff)
docs: document how to stop file watcher (#10403)
-rw-r--r--cli/dts/lib.deno.ns.d.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index c8ab9918d..eaf48dade 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -1947,6 +1947,16 @@ declare namespace Deno {
*```
*
* Requires `allow-read` permission.
+ *
+ * Call `watcher.return()` to stop watching.
+ *
+ * ```ts
+ * const watcher = Deno.watchFs("/");
+ * setTimeout(() => { watcher.return(); }, 5000);
+ * for await (const event of watcher) {
+ * console.log(">>>> event", event);
+ * }
+ * ```
*/
export function watchFs(
paths: string | string[],