npm.plugin.zsh 950 B

12345678910111213141516171819202122232425262728293031323334353637
  1. (( $+commands[npm] )) && {
  2. __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
  3. if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
  4. npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE
  5. fi
  6. source $__NPM_COMPLETION_FILE
  7. }
  8. # Install dependencies globally
  9. alias npmg="npm i -g "
  10. # npm package names are lowercase
  11. # Thus, we've used camelCase for the following aliases:
  12. # Install and save to dependencies in your package.json
  13. # npms is used by https://www.npmjs.com/package/npms
  14. alias npmS="npm i -S "
  15. # Install and save to dev-dependencies in your package.json
  16. # npmd is used by https://github.com/dominictarr/npmd
  17. alias npmD="npm i -D "
  18. # Execute command from node_modules folder based on current directory
  19. # i.e npmE gulp
  20. alias npmE='PATH="$(npm bin)":"$PATH"'
  21. # Check which npm modules are outdated
  22. alias npmO="npm outdated"
  23. # Run npm start
  24. alias npmst="npm start"
  25. # Run npm test
  26. alias npmt="npm test"