npm.plugin.zsh 901 B

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