1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 09:39:08 -05:00

docs: document how to stop file watcher (#10403)

This commit is contained in:
Yoshiya Hinosawa 2021-04-28 21:37:16 +09:00 committed by GitHub
parent 3a03084580
commit 8c6f977192
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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[],