const fs = require('fs')
const path = require('path')
function traverse(route) {
var r = fs.readdirSync(route)
r.forEach(function (element) {
var result = fs.statSync(element)
if (result.isFile()) {
// console.log(path.extname(element))
console.log(element)
}
else if (result.isDirectory()) {
traverse(
path.resolve(route, element)
)
}
})
}
var route = path.resolve('./')
traverse(route);请问这个错误在哪里 ,,看了好久也没找出来
- 2 回答
- 0 关注
- 313 浏览
添加回答
举报
0/150
提交
取消