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);
请问这个错误在哪里 ,,看了好久也没找出来
偶然的你
手掌心