tryrequire
try to require
Last updated 12 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install tryrequire 
SYNC missed versions from official npm registry.

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

Current Tags

  • 3.0.0                                ...           latest (7 years ago)

11 Versions

  • 3.0.0                                ...           7 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.1.5                                ...           12 years ago
  • 1.1.4                                ...           12 years ago
  • 1.1.3                                ...           12 years ago
  • 1.1.2                                ...           12 years ago
  • 1.1.1                                ...           12 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 24
Today 0
This Week 9
This Month 12
Last Day 0
Last Week 1
Last Month 2
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE