MCPcopy Index your code
hub / github.com/nodejs/node / #getStats

Method #getStats

lib/internal/vfs/watcher.js:420–428  ·  view source on GitHub ↗

* Gets stats for the watched path. * @returns {Stats} The stats (with zeroed values if file doesn't exist)

()

Source from the content-addressed store, hash-verified

418 * @returns {Stats} The stats (with zeroed values if file doesn't exist)
419 */
420 #getStats() {
421 try {
422 return this.#vfs.statSync(this.#path, { bigint: this.#bigint });
423 } catch {
424 // Return a zeroed stats object for non-existent files
425 // This matches Node.js behavior
426 return this.#createZeroStats();
427 }
428 }
429
430 /**
431 * Creates a zeroed stats object for non-existent files.

Callers 2

constructorMethod · 0.95
#pollMethod · 0.95

Calls 2

#createZeroStatsMethod · 0.95
statSyncMethod · 0.45

Tested by

no test coverage detected