Browse Source

node: Add handy aliases for 'npm'

Add standard `npm` aliases that are used frequently.
master
Indrajit Raychaudhuri 4 years ago committed by Indrajit Raychaudhuri
parent
commit
e22a8de5e7
  1. 19
      modules/node/README.md
  2. 20
      modules/node/init.zsh

19
modules/node/README.md

@ -27,6 +27,25 @@ _`$XDG_CONFIG_HOME/nvm`_, _`~/.nvm`_, or is installed with homebrew.
- `N_PREFIX` stores the path to [_n_][8] cache. - `N_PREFIX` stores the path to [_n_][8] cache.
## Aliases
### npm
- `npmi` install a package.
- `npml` list installed packages.
- `npmo` check for outdated packages.
- `npmp` publish a package.
- `npmP` remove extraneous packages.
- `npmr` run arbitrary package scripts.
- `npms` search for packages.
- `npmt` test a package.
- `npmu` update packages.
- `npmx` uninstalls a package.
- `npmci` install a project with a clean slate.
- `npmcit` install a project with a clean slate and run tests.
- `npmit` install package(s) and run tests.
## Functions ## Functions
- `node-doc` opens the Node.js online [API documentation][3] in the default - `node-doc` opens the Node.js online [API documentation][3] in the default

20
modules/node/init.zsh

@ -43,3 +43,23 @@ fi
# #
N_PREFIX="${XDG_CONFIG_HOME:-$HOME/.config}/n" # The path to 'n' cache. N_PREFIX="${XDG_CONFIG_HOME:-$HOME/.config}/n" # The path to 'n' cache.
#
# Aliases
#
# npm
alias npmi='npm install'
alias npml='npm list'
alias npmo='npm outdated'
alias npmp='npm publish'
alias npmP='npm prune'
alias npmr='npm run'
alias npms='npm search'
alias npmt='npm test'
alias npmu='npm update'
alias npmx='npm uninstall'
alias npmci='npm ci'
alias npmcit='npm cit'
alias npmit='npm it'

Loading…
Cancel
Save