MCPcopy Create free account
hub / github.com/nodejs/node / rimraf

Function rimraf

lib/internal/fs/rimraf.js:37–55  ·  view source on GitHub ↗
(path, options, callback)

Source from the content-addressed store, hash-verified

35
36
37function rimraf(path, options, callback) {
38 let retries = 0;
39
40 _rimraf(path, options, function CB(err) {
41 if (err) {
42 if (retryErrorCodes.has(err.code) && retries < options.maxRetries) {
43 retries++;
44 const delay = retries * options.retryDelay;
45 return setTimeout(_rimraf, delay, path, options, CB);
46 }
47
48 // The file is already gone.
49 if (err.code === 'ENOENT')
50 err = null;
51 }
52
53 callback(err);
54 });
55}
56
57
58function _rimraf(path, options, callback) {

Callers 3

rmFunction · 0.85
_rmchildrenFunction · 0.85
rimrafPromisesFunction · 0.85

Calls 4

_rimrafFunction · 0.85
hasMethod · 0.65
setTimeoutFunction · 0.50
callbackFunction · 0.50

Tested by

no test coverage detected