I’m working on a package to add debug code to source in the user’s project. This debug code (not my package code) requires an npm module. Is there a good way to make sure the user’s code will have that module
I already add a require statement to the top of the user’s source file but it would be convenient to also add the module to the users’ project automatically. I’m thinking of reading their package file and if it isn’t there then spawn a process to run
mpn install xxx --save. Is there a better way?