1 const fs
= require("fs");
3 function deleteFolderRecursive(path
) {
4 if (fs
.existsSync(path
)) {
5 fs
.readdirSync(path
).forEach((file
) => {
6 const curPath
= path
+ "/" + file
;
7 if (fs
.statSync(curPath
).isDirectory()) {
9 deleteFolderRecursive(curPath
);
12 fs
.unlinkSync(curPath
);
19 module
.exports
= deleteFolderRecursive
;