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

Method constructor

lib/internal/vfs/watcher.js:399–414  ·  view source on GitHub ↗

* @param {VirtualProvider} provider The VFS provider * @param {string} path The path to watch (provider-relative) * @param {object} [options] Options * @param {number} [options.interval] Polling interval in ms (default: 5007) * @param {boolean} [options.persistent] Keep process alive (de

(provider, path, options = kEmptyObject)

Source from the content-addressed store, hash-verified

397 * @param {boolean} [options.persistent] Keep process alive (default: true)
398 */
399 constructor(provider, path, options = kEmptyObject) {
400 super();
401
402 this.#vfs = provider;
403 this.#path = path;
404 this.#interval = options.interval ?? 5007;
405 this.#persistent = options.persistent !== false;
406 this.#bigint = options.bigint === true;
407 this.#listeners = new SafeSet();
408
409 // Get initial stats
410 this.#lastStats = this.#getStats();
411
412 // Start polling
413 this.#startPolling();
414 }
415
416 /**
417 * Gets stats for the watched path.

Callers

nothing calls this directly

Calls 2

#getStatsMethod · 0.95
#startPollingMethod · 0.95

Tested by

no test coverage detected