Is it possible with NPM to manage the same dependencies for backend and the client-side scripts? I'm building a node.js application with express. When installing all dependencies, those scripts are installed into the node_modules folder. Is it possible to somehow tell express that it should look in those folder for javascript files for the client? E.g. when the client requests the file underscore.js, it should return the file from the installed module. Or is it possible to hook in to the npm installation procedure so that some files can be automatically copied to the public folder of the application?
You can hook into NPM after it installs the packages required by your application using postinstall
in the scripts field in package.json:
For more read here: http://npmjs.org/doc/scripts.html