Lazy Require
Lazy require allows you to require modules lazily, meaning that when you lazy require a missing module, it is automatically installed. If the installation or require fails, the error is returned to the lazy require callback.
Install
- Install Node.js
npm install --save lazy-require
Usage
var lazyRequire = require('lazy-require').lazyRequire;
lazyRequire('iconv', function(err,iconv){
if (err) return console.log('iconv failed to load because of:', err.stack);
});
History
You can discover the history inside the History.md
file
License
Licensed under the incredibly permissive MIT License
Copyright © 2013+ Bevry Pty Ltd