mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 01:02:09 +02:00

removes unnecssary --save flag (added by default in npm > 5). Adds an example that installs a package wihtout a version since thats a simpler case. Moves the global install example down the page since it's a more complicated case Switch to the longversion of global option (`--global`) instead of `-g` to comply with styleguide Simplified description of adding dependency Switched from the terms "dependency" and "module" to "package" where possible since package is more idiomatic in this context. Remove `npm list --global` example to keep page under 8 example limit
891 B
891 B
npm
JavaScript and Node.js package manager. Manage Node.js projects and their module dependencies. Homepage: https://www.npmjs.com/.
- Interactively create a package.json file:
npm init
- Download all the packages listed as dependencies in package.json:
npm install
- Download a specific version of a package and add it to the list of dependencies in package.json:
npm install {{module_name}}@{{version}}
- Download a package and add it to the list of dev dependencies in package.json:
npm install {{module_name}} --save-dev
- Download a package and install it globally:
npm install -g {{module_name}}
- Uninstall a package and remove it from the list of dependencies in package.json:
npm uninstall {{module_name}}
- Print a tree of installed, project-level packages:
npm list
- List top-level globally installed modules:
npm list -g --depth={{0}}