$ npm install tryrequire
Try to require and if could not return undefined.
undefined
npm i tryrequire --save
const tryRequire = require('tryrequire'); const config = tryRequire('./config') || {};
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE