懒惰的要求
Lazy require允许您懒惰地需求模块,这意味着当您懒惰的需求中缺少模块时,lazy require会自动为您安装它。
用法
// Import
var lazyRequire = require ( 'lazy-require' )
// Attempt to load the module `ambi`, if it doesn't exist, then try to install it and load it again
// Do this synchronously, only available in Node 0.12 and above
// Passing a callback as the 3rd argument will do this asynchronously, available in all node v
评论0
最新资源