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

Function findVFSWith

lib/internal/vfs/setup.js:126–138  ·  view source on GitHub ↗
(filename, syscall, fn)

Source from the content-addressed store, hash-verified

124
125// Sync read: check exists first, fall through to ENOENT for mounted VFS.
126function findVFSWith(filename, syscall, fn) {
127 const normalized = resolve(filename);
128 for (let i = 0; i < activeVFSList.length; i++) {
129 const vfs = activeVFSList[i];
130 if (vfs.shouldHandle(normalized)) {
131 if (vfs.existsSync(normalized)) {
132 return fn(vfs, normalized);
133 }
134 throw createENOENT(syscall, filename);
135 }
136 }
137 return undefined;
138}
139
140function vfsRead(path, syscall, fn) {
141 const pathStr = toPathStr(path);

Callers 2

vfsReadFunction · 0.85
readFileSyncFunction · 0.85

Calls 5

createENOENTFunction · 0.85
shouldHandleMethod · 0.80
resolveFunction · 0.50
fnFunction · 0.50
existsSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…