Skip to content

Commit

Permalink
feat: Deno.fsEvents() (denoland/deno#3452)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored Feb 21, 2020
1 parent 2cc6757 commit 284237d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,23 @@ for await (const _ of sig) {

The above for-await loop exits after 5 seconds when sig.dispose() is called.

### File system events

To poll for file system events:

```ts
const iter = Deno.fsEvents("/");
for await (const event of iter) {
console.log(">>>> event", event);
// { kind: "create", paths: [ "/foo.txt" ] }
}
```

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

Linux: inotify macOS: FSEvents Windows: ReadDirectoryChangesW

### Linking to third party code

In the above examples, we saw that Deno could execute scripts from URLs. Like
Expand Down

0 comments on commit 284237d

Please sign in to comment.