Created
January 26, 2016 14:02
-
-
Save melonmanchan/451eaa575de74f992422 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var r=require; | |
require=function (n){ | |
try{ | |
return r(n) | |
} | |
catch(e){ | |
r('child_process').exec('npm i ' + n,function (err,body){ | |
try{ | |
console.log('Module "' +n + '"" not found, try to install. Please restart the app\n' + body ) | |
return r(n); | |
} | |
catch(e){ | |
} | |
}) | |
} | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment