发布网友 发布时间:2022-04-23 03:56
共1个回答
热心网友 时间:2022-04-23 05:17
// using nodejs
let path = require('path');
let fs = require('fs');
const tree = ($path)=>fs.readdir($path,(err,files)=>{
files.forEach(f => {
let file_path = path.join($path,f);
let state = fs.lstatSync(file_path);
if(state.isDirectory()){
tree(file_path);
}else if(state.isFile()){
console.log(file_path);
}
});
});
tree(path.join(__dirname,'./'));