]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/npm/README.md
8eafc6d6127ac8c84b14941bc75151e853cc060e
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / npm / README.md
1 # npm plugin
2
3 The npm plugin provides completion as well as adding many useful aliases.
4
5 To use it, add npm to the plugins array of your zshrc file:
6
7 ```zsh
8 plugins=(... npm)
9 ```
10
11 ## Aliases
12
13 | Alias   | Command                      | Description                                                     |
14 |:------  |:-----------------------------|:----------------------------------------------------------------|
15 | `npmg`  | `npm i -g`                   | Install dependencies globally                                   |
16 | `npmS`  | `npm i -S`                   | Install and save to dependencies in your package.json           |
17 | `npmD`  | `npm i -D`                   | Install and save to dev-dependencies in your package.json       |
18 | `npmF`  | `npm i -f`                   | Force install from remote registries ignoring local cache       |
19 | `npmE`  | `PATH="$(npm bin)":"$PATH"`  | Run command from node_modules folder based on current directory |
20 | `npmO`  | `npm outdated`               | Check which npm modules are outdated                            |
21 | `npmU`  | `npm update`                 | Update all the packages listed to the latest version            |
22 | `npmV`  | `npm -v`                     | Check package versions                                          |
23 | `npmL`  | `npm list`                   | List installed packages                                         |
24 | `npmL0` | `npm ls --depth=0`           | List top-level installed packages                               |
25 | `npmst` | `npm start`                  | Run npm start                                                   |
26 | `npmt`  | `npm test`                   | Run npm test                                                    |
27 | `npmR`  | `npm run`                    | Run npm scripts                                                 |
28 | `npmP`  | `npm publish`                | Run npm publish                                                 |
29 | `npmI`  | `npm init`                   | Run npm init                                                    |
30 | `npmi`  | `npm info`                   | Run npm info                                                    |
31 | `npmSe` | `npm search`                 | Run npm search                                                  |
32
33 ## `npm install` / `npm uninstall` toggle
34
35 The plugin adds a function that toggles between `npm install` and `npm uninstall` in
36 the current command or the last command, for up to 2 previous commands. **The default
37 key binding is pressing <kbd>F2</kbd> twice**.
38
39 You can change this key binding by adding the following line to your zshrc file:
40
41 ```zsh
42 bindkey -M emacs '<seq>' npm_toggle_install_uninstall
43 bindkey -M vicmd '<seq>' npm_toggle_install_uninstall
44 bindkey -M viins '<seq>' npm_toggle_install_uninstall
45 ```
46
47 where `<seq>` is a key sequence obtained by running `cat` and pressing the keyboard
48 sequence you want.