peice-498
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
1
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
}