my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.8 KiB

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