安装
npm install rimraf ^2.5.2 --save-dev
'use strict';
const rimraf = require('rimraf')
let dashdash = false
let args = process.argv.slice(2).filter((arg) => {
if(dashdash) return !!arg
else if(arg === '--') dashdash = true
else return !!arg
})
let rm = (n) => {
if(n >= args.length) return
rimraf(args[n], (err) => {
if (err) throw err
rm(n + 1)
})
}
if(args.length) rm(0)