Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
⌘K
Up or down tonavigateEnter toselectEscape toclose
On this page

File system events

ConceptsJump to heading

  • UseDeno.watchFs to watch forfile system events.
  • Results may vary between operating systems.

ExampleJump to heading

To poll for file system events in the current directory:

watcher.ts
const watcher= Deno.watchFs(".");forawait(const eventof watcher){console.log(">>>> event", event);// Example event: { kind: "create", paths: [ "/home/alice/deno/foo.txt" ] }}

Run with:

deno run --allow-read watcher.ts

Now try adding, removing and modifying files in the same directory aswatcher.ts.

Note that the exact ordering of the events can vary between operating systems.This feature uses different syscalls depending on the platform:

Did you find what you needed?

What can we do to improve this page?

If provided, you'll be @mentioned in the created GitHub issue

Privacy policy

[8]ページ先頭

©2009-2025 Movatter.jp