Add npm-version command to npm cheatsheet (#1553)

This commit is contained in:
Joshua Inho Jung 2023-01-31 17:56:35 +09:00 committed by GitHub
parent b91885ec71
commit 6b4c9ef35d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

5
npm.md
View File

@ -17,6 +17,11 @@ updated: 2019-12-24
| `npm install lodash` | Install a package |
| `npm install --save-dev lodash` | Install as devDependency |
| `npm install --save-exact lodash` | Install with exact |
| --- | --- |
| `npm version 1.2.3` | Bump the package version to 1.2.3 |
| `npm version major` | Bump the major package version by 1 (1.2.3 → 2.0.0) |
| `npm version minor` | Bump the minor package version by 1 (1.2.3 → 1.3.0) |
| `npm version patch` | Bump the patch package version by 1 (1.2.3 → 1.2.4) |
`--save` is the default as of npm@5. Previously, using `npm install` without `--save` doesn't update package.json.