1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 01:02:09 +02:00
tldr/pages/common/npm.md
Raymond Douglas 5b9848dc64
npm.md: additional module listing use case
Made changes per suggestions by agnivade.
2017-11-22 22:06:43 -08:00

813 B

npm

JavaScript and Node.js package manager. Manage Node.js projects and their module dependencies.

  • Download and install a module globally:

npm install -g {{module_name}}

  • Download all dependencies referenced in package.json:

npm install

  • Download a given dependency required for the application to run, and add it to the package.json:

npm install {{module_name}}@{{version}} --save

  • Download a given dependency for development purposes, and add it to the package.json:

npm install {{module_name}}@{{version}} --save-dev

  • Uninstall a module:

npm uninstall {{module_name}}

  • List of tree of installed modules referenced in package.json:

npm list

  • List top-level globally installed modules:

npm list -g --depth={{0}}

  • Interactively create a package.json file:

npm init