Requiry checks process.env.NODE_ENV, and if you are in a "dev" environment, it
will auto-install packages when you
require packages that are not installed.
In your project directory, run:
npm i --save requiry
To use Requiry, you simply need to require it, then require a package which may or may not be installed.
;var something = ;
If you run your application without specifying an environment, or specifying
an environment other than "dev", the
require function will operate as usual,
MODULE_NOT_FOUND error if
something isn't installed. However,
if you run in "dev" mode, it will install
something for you.
NODE_ENV=dev node app
You can make requiry use a custom logger by passing it in.
If you would like to disable Requiry, even in "dev" mode, you can call