Package Exports
- tryrequire
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tryrequire) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Try Require
Try to require and if could not return undefined.
Install
npm i tryrequire --saveOptions
- log : will log error when could not load
- callback : will return function wich will have error parameter.
How to use?
const tryRequire = require('tryrequire');
const config = tryRequire('./config') || {}; License
MIT