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

Function watchFile

test/pummel/test-watch-file.js:34–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33let changes = 0;
34function watchFile() {
35 fs.watchFile(f, (curr, prev) => {
36 // Make sure there is at least one watch event that shows a changed mtime.
37 if (curr.mtime <= prev.mtime) {
38 return;
39 }
40 changes++;
41 fs.unwatchFile(f);
42 watchFile();
43 fs.unwatchFile(f);
44 });
45}
46
47watchFile();
48

Callers 1

test-watch-file.jsFile · 0.70

Calls 2

watchFileMethod · 0.45
unwatchFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…