tryrequire

3.0.0 • Public • Published

Try Require

Try to require and if could not return undefined.

Install

npm i tryrequire --save

Options

  • 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

Readme

Keywords

Package Sidebar

Install

npm i tryrequire

Weekly Downloads

463

Version

3.0.0

License

MIT

Unpacked Size

2.85 kB

Total Files

5

Last publish

Collaborators

  • coderaiser