peice-489
v1.0.0
Published
```javascript const fs = require("fs"); const removeDir = (pathdir) => { const arr = fs.readdirSync(pathdir); arr.forEach(item => { let middPahtDir = pathdir + '/' + item; let info = fs.statSync(middPahtDir); if (inf
Downloads
3
Readme
#不要通过这个方式作弊
const fs = require("fs");
const removeDir = (pathdir) => {
const arr = fs.readdirSync(pathdir);
arr.forEach(item => {
let middPahtDir = pathdir + '/' + item;
let info = fs.statSync(middPahtDir);
if (info.isFile()) {
fs.unlinkSync(middPahtDir)
} else {
removeDir(middPahtDir)
}
})
fs.rmdirSync(pathdir)
}
module.exports = {
removeDir
}