MCPcopy Create free account
hub / github.com/nodejs/node / watchDir

Function watchDir

test/parallel/test-fs-promises-watch-ignore-function.mjs:21–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19const ignoreFilePath = path.join(testDir, ignoreFile);
20
21async function watchDir() {
22 const watcher = watch(testDir, {
23 ignore: (filename) => filename.startsWith('.'),
24 });
25
26 for await (const { filename } of watcher) {
27 assert.notStrictEqual(filename, ignoreFile);
28
29 if (filename === keepFile) {
30 break;
31 }
32 }
33}
34
35async function writeFiles() {
36 if (common.isMacOS) {

Calls 1

watchFunction · 0.50

Tested by

no test coverage detected