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

Function removeAsync

test/parallel/test-fs-rm.js:86–105  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

84}
85
86function removeAsync(dir) {
87 // Removal should fail without the recursive option.
88 fs.rm(dir, common.mustCall((err) => {
89 assert.strictEqual(err.syscall, 'rm');
90
91 // Removal should fail without the recursive option set to true.
92 fs.rm(dir, common.mustNotMutateObjectDeep({ recursive: false }), common.mustCall((err) => {
93 assert.strictEqual(err.syscall, 'rm');
94
95 // Recursive removal should succeed.
96 fs.rm(dir, common.mustNotMutateObjectDeep({ recursive: true }), common.mustSucceed(() => {
97
98 // Attempted removal should fail now because the directory is gone.
99 fs.rm(dir, common.mustCall((err) => {
100 assert.strictEqual(err.syscall, 'lstat');
101 }));
102 }));
103 }));
104 }));
105}
106
107// Test the asynchronous version
108{

Callers 1

test-fs-rm.jsFile · 0.85

Calls 1

rmMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…