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

Method close

lib/internal/vfs/watcher.js:337–355  ·  view source on GitHub ↗

* Closes the watcher and stops polling.

()

Source from the content-addressed store, hash-verified

335 * Closes the watcher and stops polling.
336 */
337 close() {
338 if (this.#closed) return;
339 this.#closed = true;
340
341 if (this.#timer) {
342 clearInterval(this.#timer);
343 this.#timer = null;
344 }
345
346 // Clear tracked files
347 this.#trackedFiles.clear();
348
349 // Remove abort handler
350 if (this.#signal && this.#abortHandler) {
351 this.#signal.removeEventListener('abort', this.#abortHandler);
352 }
353
354 this.emit('close');
355 }
356
357 /**
358 * Alias for close() - compatibility with FSWatcher.

Callers 1

constructorMethod · 0.95

Calls 4

clearIntervalFunction · 0.85
clearMethod · 0.65
removeEventListenerMethod · 0.65
emitMethod · 0.45

Tested by

no test coverage detected