MCPcopy Index your code
hub / github.com/nodejs/node / watchFiles

Method watchFiles

test/parallel/test-fs-promises-watch-iterator.js:30–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 assert(!this.files.length);
29 }
30 async watchFiles() {
31 const watcher = watch(this.dirPath);
32 for await (const evt of watcher) {
33 const idx = this.files.indexOf(evt.filename);
34 if (idx < 0) continue;
35 this.files.splice(idx, 1);
36 await setTimeout(common.platformTimeout(100));
37 if (!this.files.length) break;
38 }
39 }
40 async writeFiles() {
41 if (common.isMacOS) {
42 // Do the write with a delay to ensure that the OS is ready to notify us.

Callers 1

runMethod · 0.95

Calls 3

watchFunction · 0.50
setTimeoutFunction · 0.50
indexOfMethod · 0.45

Tested by

no test coverage detected