npx-run
Version:
Easily run scripts using npx.
21 lines (17 loc) • 415 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.loadModuleIfExists = void 0;
const loadModuleIfExists = name => {
require('./loaders');
try {
return require(name);
} catch (err) {
// if there is any issue with the module we should throw
if (err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
}
};
exports.loadModuleIfExists = loadModuleIfExists;