feat(npm): add alias for `npm i -f` (#8454)
As documented in the README, `npm i -f` forces npm to install the specified packages from a remote
package registry, even if local copies exist on disk caches.
Diff
1diff --git a/plugins/npm/README.md b/plugins/npm/README.md
2index 0b1a2280f27edc2931ba3b28bf575a8b1747434f..bc627e56f7ab5763b998c29b7381d0bd46ab5d8f 100644
3--- a/plugins/npm/README.md
4+++ b/plugins/npm/README.md
5@@ -15,6 +15,7 @@ plugins=(... npm)
6 | `npmg` | `npm i -g` | Install dependencies globally |
7 | `npmS` | `npm i -S` | Install and save to dependencies in your package.json |
8 | `npmD` | `npm i -D` | Install and save to dev-dependencies in your package.json |
9+| `npmF` | `npm i -f` | Force install from remote registries ignoring local cache |
10 | `npmE` | `PATH="$(npm bin)":"$PATH"` | Run command from node_modules folder based on current directory |
11 | `npmO` | `npm outdated` | Check which npm modules are outdated |
12 | `npmV` | `npm -v` | Check package versions |
13diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
14index 87c68f3fb091c0215ad77b59f7609543b3342e85..93de9cba3e1cac8421efb8192f3e32fa10590734 100644
15--- a/plugins/npm/npm.plugin.zsh
16+++ b/plugins/npm/npm.plugin.zsh
17@@ -27,6 +27,9 @@ alias npmS="npm i -S "
18 # npmd is used by https://github.com/dominictarr/npmd
19 alias npmD="npm i -D "
2021+# Force npm to fetch remote resources even if a local copy exists on disk.
22+alias npmF='npm i -f'
23+
24 # Execute command from node_modules folder based on current directory
25 # i.e npmE gulp
26 alias npmE='PATH="$(npm bin)":"$PATH"'