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

Function readdir

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

Source from the content-addressed store, hash-verified

483 // ==================== Async path-based ops ====================
484
485 readdir(path, options) {
486 const promise = vfsOp(path, (vfs, n) => vfs.promises.readdir(n, options));
487 if (promise !== undefined && options?.encoding === 'buffer' && !options?.withFileTypes) {
488 return promise.then((result) => {
489 for (let i = 0; i < result.length; i++) {
490 if (typeof result[i] === 'string') result[i] = Buffer.from(result[i]);
491 }
492 return result;
493 });
494 }
495 return promise;
496 },
497 lstat(path, options) {
498 const pathStr = toPathStr(path);
499 if (pathStr === null) return undefined;

Callers

nothing calls this directly

Calls 4

vfsOpFunction · 0.85
readdirMethod · 0.45
thenMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…