@bevry/fs-list
Version:
List the entire contents of a directory.
23 lines (22 loc) • 672 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// builtin
const process_1 = require("process");
// local
const index_js_1 = __importDefault(require("./index.js"));
// for each path, readdir
for (const path of process_1.argv.slice(2)) {
(0, index_js_1.default)(path)
.then((paths) => {
if (paths.length) {
process_1.stdout.write(paths.join('\n') + '\n');
}
})
.catch((error) => {
console.error(error);
(0, process_1.exit)(1);
});
}