Client Script Management with npm

Is it possible to use NPM to manage the same dependencies for backend and client scripts? I am creating a node.js application with an expression. When all dependencies are installed, these scripts are installed in the node_modules folder. Can I somehow say that it should look in this folder for javascript files for the client? For instance. when the client requests the underscore.js file, it should return the file from the installed module. Or can you connect to the npm installation procedure so that some files can be automatically copied to the application’s shared folder?

+5
source share
1 answer

You can connect to NPM after installing the packages required by your application using postinstallthe scripts field in package.json:

  • install, postinstall: run AFTER installing the package.

Read more here: http://npmjs.org/doc/scripts.html

+3
source

All Articles