code: function remove(path) {
  	let files = [];
  	if( fs.existsSync(path) ) {
  		if(fs.statSync(path).isFile()){
  			fs.unlinkSync(path);
  			return;
  		}
  
  		files = fs.readdirSync(path);
  		files.forEach(function(file, index){
  			let curPath = path + "/" + file;
  			if(fs.statSync(curPath).isDirectory()) {
  				remove(curPath)
  			} else {
  				fs.unlinkSync(curPath);
  			}
  		});
  		fs.rmdirSync(path, err=>console.error(err));
  	}
  }
docs: 删除文件或目录（含子目录及文件）