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

Function readlink

lib/fs.js:2118–2132  ·  view source on GitHub ↗

* Reads the contents of a symbolic link * referred to by `path`. * @param {string | Buffer | URL} path * @param {{ encoding?: string; } | string} [options] * @param {( * err?: Error, * linkString?: string | Buffer * ) => any} callback * @returns {void}

(path, options, callback)

Source from the content-addressed store, hash-verified

2116 * @returns {void}
2117 */
2118function readlink(path, options, callback) {
2119 if (typeof options === 'function') {
2120 callback = options;
2121 options = undefined;
2122 }
2123
2124 const h = vfsState.handlers;
2125 if (h !== null && vfsResult(h.readlink(path, options), callback)) return;
2126
2127 callback = makeCallback(callback);
2128 options = getOptions(options);
2129 const req = new FSReqCallback();
2130 req.oncomplete = callback;
2131 binding.readlink(getValidatedPath(path), options.encoding, req);
2132}
2133
2134/**
2135 * Synchronously reads the contents of a symbolic link

Callers

nothing calls this directly

Calls 4

vfsResultFunction · 0.85
makeCallbackFunction · 0.70
getOptionsFunction · 0.50
readlinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…