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

Function readdirSync

lib/internal/vfs/setup.js:206–214  ·  view source on GitHub ↗
(path, options)

Source from the content-addressed store, hash-verified

204 return findVFSWith(pathStr, 'open', (vfs, n) => vfs.readFileSync(n, options));
205 },
206 readdirSync(path, options) {
207 const result = vfsRead(path, 'scandir', (vfs, n) => vfs.readdirSync(n, options));
208 if (result !== undefined && options?.encoding === 'buffer' && !options?.withFileTypes) {
209 for (let i = 0; i < result.length; i++) {
210 if (typeof result[i] === 'string') result[i] = Buffer.from(result[i]);
211 }
212 }
213 return result;
214 },
215 lstatSync(path, options) {
216 const pathStr = toPathStr(path);
217 if (pathStr === null) return undefined;

Callers 2

readdirSyncMethod · 0.50
#watchFolderMethod · 0.50

Calls 3

vfsReadFunction · 0.85
readdirSyncMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…