一、创建文件夹
(1)创建单一文件夹:
fs.mkdir(path,[option],callback);
fs.mkdirSync(path,[option]);
(2)递归创建 一层一层的文件夹
fs.mkdir(path,{recursive:true},callback);
fs.mkdirSync(path,{recursive:true});
二、读取文件夹
fs.readdir(path,[option],callback(err,data)=>{});
fs.readdirSync(path,callback(err,data)=>{});
三、删除文件夹
(1)删除单一文件夹
fs.rm(path,[option],callback=>{});
fs.rmSync(path,callback=>{});
(2)递归删除 一层一层的文件夹
fs.rm(path,{recursive:true},callback=>{});
fs.rmSync(path,callback=>{});