Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function runAsync() {
try {
program.name('expotools');
program.version(require('../package.json').version);
// Load each module found in ./commands by 'registering' it with our commander instance
glob
.sync('commands/*.js', {
cwd: __dirname,
})
.forEach(file => {
const commandModule = require(`./${file}`);
if (typeof commandModule === 'function') {
commandModule(program);
} else if (typeof commandModule.default === 'function') {
commandModule.default(program);
} else {
console.error(`"${file}.js" is not a properly formatted command.`);
}
});