Чет типа того.
let fs = require('fs'),
path = require('path')
function read(root) {
let files = fs.readdirSync(root)
for(let i = 0; i < files.length; i ++) {
let name = [root, files[i]].join('/')
name = path.normalize(name)
console.log(name)
let stat = fs.statSync(name)
if (stat.isDirectory()) {
read(name)
}
}
}
read(__dirname)