mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-12 02:58:50 +00:00
Update cheatsheets
This commit is contained in:
42
npm
Normal file
42
npm
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# npm
|
||||
|
||||
> JavaScript and Node.js package manager.
|
||||
> Manage Node.js projects and their module dependencies.
|
||||
> More information: <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 {{package_name}}@{{version}}`
|
||||
|
||||
- Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
|
||||
|
||||
`npm install {{package_name}} --save-dev`
|
||||
|
||||
- Download the latest version of a package and install it globally:
|
||||
|
||||
`npm install --global {{package_name}}`
|
||||
|
||||
- Uninstall a package and remove it from the list of dependencies in `package.json`:
|
||||
|
||||
`npm uninstall {{package_name}}`
|
||||
|
||||
- List of locally installed dependencies:
|
||||
|
||||
`npm list`
|
||||
|
||||
- List top-level globally installed packages:
|
||||
|
||||
`npm list --global --depth={{0}}`
|
||||
Reference in New Issue
Block a user