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

Function rm

lib/fs.js:1445–1463  ·  view source on GitHub ↗

* Asynchronously removes files and * directories (modeled on the standard POSIX `rm` utility). * @param {string | Buffer | URL} path * @param {{ * force?: boolean; * maxRetries?: number; * recursive?: boolean; * retryDelay?: number; * }} [options] * @param {(err?: Error) => any} c

(path, options, callback)

Source from the content-addressed store, hash-verified

1443 * @returns {void}
1444 */
1445function rm(path, options, callback) {
1446 if (typeof options === 'function') {
1447 callback = options;
1448 options = undefined;
1449 }
1450
1451 const h = vfsState.handlers;
1452 if (h !== null && vfsVoid(h.rm(path, options), callback)) return;
1453
1454 path = getValidatedPath(path);
1455
1456 validateRmOptions(path, options, false, (err, options) => {
1457 if (err) {
1458 return callback(err);
1459 }
1460 lazyLoadRimraf();
1461 return rimraf(path, options, callback);
1462 });
1463}
1464
1465/**
1466 * Synchronously removes files and

Calls 5

vfsVoidFunction · 0.85
lazyLoadRimrafFunction · 0.85
rimrafFunction · 0.85
callbackFunction · 0.50
rmMethod · 0.45

Tested by

no test coverage detected