I'm playing with the idea of monkeypatching require in development and when trying to require a path that isn't available, it checks to see if it might be an npm path and if so, attempts to download the package from npm.
I have this almost working, but there's some stat caching in the internal module system, so it is not picking up the newly installed module.
Does this seem like a good idea? It would allow the developer to not have to stop the server when they need to install a new module.
I'm playing with the idea of monkeypatching
require
in development and when trying to require a path that isn't available, it checks to see if it might be an npm path and if so, attempts to download the package from npm.I have this almost working, but there's some stat caching in the internal module system, so it is not picking up the newly installed module.
Does this seem like a good idea? It would allow the developer to not have to stop the server when they need to install a new module.