An open API service indexing awesome lists of open source software.

https://github.com/coderaiser/node-tryrequire

Try to require
https://github.com/coderaiser/node-tryrequire

Last synced: about 2 months ago
JSON representation

Try to require

Awesome Lists containing this project

README

          

# 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?

```js
const tryRequire = require('tryrequire');
const config = tryRequire('./config') || {};
```

## License

MIT