Skip to content

Commit db7c1f8

Browse files
authored
feat: add u as alias for update command (#9163)
## Summary Adds `u` as a short alias for the `update` command, making it consistent with `i` for `install`. ## Motivation `npm i` is the canonical short form for `npm install` — the most commonly used npm command. However, `npm update` lacks an equivalent single-character alias. The existing `npm up` alias works, but feels inconsistent compared to `i`. Adding `u` makes the CLI more ergonomic and intuitive: ```sh npm i # install ✅ already exists npm u # update ✅ this PR ``` ## Changes - Added `u: 'update'` alias in `lib/utils/cmd-list.js`, grouped alongside the existing `up: 'update'` alias ## Notes - `u` is not currently used by any other alias or command, so there is no conflict - Follows the same pattern as other single-character aliases (`i`, `r`, `t`, `c`, `s`, `v`, `x`)
1 parent 9669d31 commit db7c1f8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/utils/cmd-list.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const aliases = {
9797
i: 'install',
9898
it: 'install-test',
9999
cit: 'install-ci-test',
100+
u: 'update',
100101
up: 'update',
101102
c: 'config',
102103
s: 'search',

tap-snapshots/test/lib/docs.js.test.cjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Object {
8080
"sit": "install-ci-test",
8181
"t": "test",
8282
"tst": "test",
83+
"u": "update",
8384
"udpate": "update",
8485
"un": "uninstall",
8586
"unlink": "uninstall",
@@ -6033,14 +6034,14 @@ Options:
60336034
When set file: protocol dependencies will be packed and installed as
60346035
60356036
6036-
aliases: up, upgrade, udpate
6037+
aliases: u, up, upgrade, udpate
60376038
60386039
Run "npm help update" for more info
60396040
60406041
\`\`\`bash
60416042
npm update [<pkg>...]
60426043
6043-
aliases: up, upgrade, udpate
6044+
aliases: u, up, upgrade, udpate
60446045
\`\`\`
60456046
60466047
#### \`save\`

0 commit comments

Comments
 (0)