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

Function link

lib/fs.js:2269–2282  ·  view source on GitHub ↗

* Creates a new link from the `existingPath` * to the `newPath`. * @param {string | Buffer | URL} existingPath * @param {string | Buffer | URL} newPath * @param {(err?: Error) => any} callback * @returns {void}

(existingPath, newPath, callback)

Source from the content-addressed store, hash-verified

2267 * @returns {void}
2268 */
2269function link(existingPath, newPath, callback) {
2270 callback = makeCallback(callback);
2271
2272 const h = vfsState.handlers;
2273 if (h !== null && vfsVoid(h.link(existingPath, newPath), callback)) return;
2274
2275 existingPath = getValidatedPath(existingPath, 'existingPath');
2276 newPath = getValidatedPath(newPath, 'newPath');
2277
2278 const req = new FSReqCallback();
2279 req.oncomplete = callback;
2280
2281 binding.link(existingPath, newPath, req);
2282}
2283
2284/**
2285 * Synchronously creates a new link from the `existingPath`

Callers

nothing calls this directly

Calls 3

vfsVoidFunction · 0.85
makeCallbackFunction · 0.70
linkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…