@bevry/fs-list
Version:
List the entire contents of a directory.
20 lines (17 loc) • 331 B
text/typescript
// builtin
import { argv, stdout, exit } from 'process'
// local
import list from './index.js'
// for each path, readdir
for (const path of argv.slice(2)) {
list(path)
.then((paths) => {
if (paths.length) {
stdout.write(paths.join('\n') + '\n')
}
})
.catch((error) => {
console.error(error)
exit(1)
})
}