Try to require and if could not return undefined
.
npm i tryrequire --save
- log : will log error when could not load
- callback : will return function wich will have error parameter.
const tryRequire = require('tryrequire');
const config = tryRequire('./config') || {};
MIT