index.js 291 B

12345678910
  1. 'use strict';
  2. const resolveFrom = require('resolve-from');
  3. module.exports = (fromDirectory, moduleId) => require(resolveFrom(fromDirectory, moduleId));
  4. module.exports.silent = (fromDirectory, moduleId) => {
  5. try {
  6. return require(resolveFrom(fromDirectory, moduleId));
  7. } catch (_) {}
  8. };