We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6887626 commit 7ff7085Copy full SHA for 7ff7085
1 file changed
README.md
@@ -122,3 +122,16 @@ Types:
122
| Method | Deno | Node | Bun | Base implementation |
123
| --------- | ---- | ---- | --- | ------------------- |
124
| FSWatcher | X | X | X | node:fs/promises |
125
+
126
+Examples:
127
128
+```typescript
129
+const watcher = FsWatcher();
130
+for await (const event of watcher.watch(tempdir)) {
131
+ if (event.kind === "modify" && filePath == event.paths[0]) {
132
+ console.log(event);
133
+ break; // Stop watching after the first creation event
134
+ }
135
+}
136
+watcher.close();
137
+```
0 commit comments