Infinite | Squares

Art of code and more

Know Your Npm

NPM (Node Packaged Modules) is indespensable part of Node.js ecosystem. Knowing how to use npm is really important when working on Node.js project. Some of the npm commands :

  • npm init –> create package.json file to start a Node.js project
  • npm install MODULENAME --save –> install module and save to dependencies in package.json
  • npm install MODULENAME --save-dev –> install module and save to devDependencies in package.json
  • npm install --production –> skip devDependencies install
  • npm shrinkwrap –> lock modules version dependency for the app
  • npm view -g --depth=0 –> list global installed modules
  • npm view MODULENAME –> view module metadata on npmjs registry, you can check available versions

Comments