From 6b4c9ef35dadafe833144eee367a1281f9e47960 Mon Sep 17 00:00:00 2001 From: Joshua Inho Jung Date: Tue, 31 Jan 2023 17:56:35 +0900 Subject: [PATCH] Add npm-version command to npm cheatsheet (#1553) --- npm.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/npm.md b/npm.md index 16a0c3284..7bfa767db 100644 --- a/npm.md +++ b/npm.md @@ -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.