1。资源地址npm地址:https://www.npmjs.com/package/rimrafGitHub地址:https://github.com/isaacs/rimraf以下内容只是这个包的一个例子简单的了解,如果想了解更多,建议查看官网。2、包的作用rimraf包的作用:将rm-rf命令以包的形式包裹起来,用于删除文件和文件夹,不管文件夹是否为空。3.安装3-1npm安装$npminstallrimraf--save-dev3-2yarn安装$yarnaddrimraf--dev4。使用这个包只提供了一种方法:rimraf(pathName,function(err){})constrimraf=require('rimraf');rimraf('./test.txt',function(err){//deletetest.txt在当前目录下console.log(err);});
