Optional
options: Optionsimport { filesystem } from "@rjweb/utils"
import path from "path"
for await (const dirent of filesystem.walk('./node_modules', { async: true, recursive: true })) {
const spaces = path.relative('./node_modules', dirent.path).split(path.sep).length - 1
console.log(' '.repeat(spaces), dirent.name)
}
1.12.3
nodejs
Walk a Directory