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

Function unlink

lib/fs.js:2313–2321  ·  view source on GitHub ↗

* Asynchronously removes a file or symbolic link. * @param {string | Buffer | URL} path * @param {(err?: Error) => any} callback * @returns {void}

(path, callback)

Source from the content-addressed store, hash-verified

2311 * @returns {void}
2312 */
2313function unlink(path, callback) {
2314 const h = vfsState.handlers;
2315 if (h !== null && vfsVoid(h.unlink(path), callback)) return;
2316
2317 callback = makeCallback(callback);
2318 const req = new FSReqCallback();
2319 req.oncomplete = callback;
2320 binding.unlink(getValidatedPath(path), req);
2321}
2322
2323/**
2324 * Synchronously removes a file or symbolic link.

Callers 1

execMethod · 0.50

Calls 3

vfsVoidFunction · 0.85
makeCallbackFunction · 0.70
unlinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…