From 8c6f97719215815eae63cfb7cdcb5def27756a3a Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 28 Apr 2021 21:37:16 +0900 Subject: [PATCH] docs: document how to stop file watcher (#10403) --- cli/dts/lib.deno.ns.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index c8ab9918d1..eaf48dade9 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[],