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

Function readlink

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

Source from the content-addressed store, hash-verified

546 });
547 },
548 readlink(path, options) {
549 const pathStr = toPathStr(path);
550 if (pathStr === null) return undefined;
551 const normalized = resolve(pathStr);
552 for (let i = 0; i < activeVFSList.length; i++) {
553 const vfs = activeVFSList[i];
554 if (vfs.shouldHandle(normalized)) {
555 const promise = vfs.promises.readlink(normalized, options);
556 if (options?.encoding === 'buffer') {
557 return promise.then((result) => Buffer.from(result));
558 }
559 return promise;
560 }
561 }
562 return undefined;
563 },
564 chown: (path, uid, gid) =>
565 vfsOp(path, (vfs, n) => vfs.promises.chown(n, uid, gid).then(() => true)),
566 lchown: (path, uid, gid) =>

Callers

nothing calls this directly

Calls 6

toPathStrFunction · 0.85
shouldHandleMethod · 0.80
resolveFunction · 0.50
readlinkMethod · 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…