From d29784e1aebab5e02db918b1ffbfa4d2d308799a Mon Sep 17 00:00:00 2001 From: Athaher Sirnaik Date: Sat, 4 Nov 2017 23:05:44 +0530 Subject: Improved npm aliases: run, publish (#6354) --- plugins/npm/npm.plugin.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/npm') diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 43aedc36d..014fb55f8 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -38,9 +38,17 @@ alias npmV="npm -v" # List packages alias npmL="npm list" +# List top-level installed packages +alias npmL0="npm ls --depth=0" + # Run npm start alias npmst="npm start" # Run npm test alias npmt="npm test" +# Run npm scripts +alias npmR="npm run" + +# Run npm publish +alias npmP="npm publish" \ No newline at end of file -- cgit v1.2.3-70-g09d2 From a8f3b374d89bd8a4b9e61001b0edd8b96a084abf Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Sun, 15 Apr 2018 19:54:42 +0200 Subject: npm init (#6648) --- plugins/npm/npm.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/npm') diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 014fb55f8..43af35ddb 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -51,4 +51,7 @@ alias npmt="npm test" alias npmR="npm run" # Run npm publish -alias npmP="npm publish" \ No newline at end of file +alias npmP="npm publish" + +# Run npm init +alias npmI="npm init" -- cgit v1.2.3-70-g09d2 From 8bbef9180e3ba16e717a9587d0c965ab901c1226 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Sat, 26 May 2018 22:22:22 +0200 Subject: Npm's plugin documentation (#6864) * Documentation for Npm plugin added * Fix style and add alias descriptions --- plugins/npm/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins/npm/README.md (limited to 'plugins/npm') diff --git a/plugins/npm/README.md b/plugins/npm/README.md new file mode 100644 index 000000000..202e2b0a4 --- /dev/null +++ b/plugins/npm/README.md @@ -0,0 +1,26 @@ +## npm plugin + +The npm plugin provides completion as well as adding many useful aliases. + +To use it, add npm to the plugins array of your zshrc file: +``` +plugins=(... npm) +``` + +## Aliases + +| Alias | Command | Descripton | +|:------ |:-----------------------------|:----------------------------------------------------------------| +| `npmg` | `npm i -g` | Install dependencies globally | +| `npmS` | `npm i -S` | Install and save to dependencies in your package.json | +| `npmD` | `npm i -D` | Install and save to dev-dependencies in your package.json | +| `npmE` | `PATH="$(npm bin)":"$PATH"` | Run command from node_modules folder based on current directory | +| `npmO` | `npm outdated` | Check which npm modules are outdated | +| `npmV` | `npm -v` | Check package versions | +| `npmL` | `npm list` | List installed packages | +| `npmL0` | `npm ls --depth=0` | List top-level installed packages | +| `npmst` | `npm start` | Run npm start | +| `npmt` | `npm test` | Run npm test | +| `npmR` | `npm run` | Run npm scripts | +| `npmP` | `npm publish` | Run npm publish | +| `npmI` | `npm init` | Run npm init | -- cgit v1.2.3-70-g09d2 From af085542bdc0e835093ed2b86f90251bc1f3d719 Mon Sep 17 00:00:00 2001 From: Alexandre Nicastro Date: Sun, 1 Jul 2018 18:21:20 -0300 Subject: Stop error "permission denied: /npm_completion" (#6340) Fixes #5874 Related: https://github.com/lukechilds/zsh-nvm/issues/23 https://github.com/zsh-users/antigen/issues/586 --- plugins/npm/npm.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/npm') diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 43af35ddb..f62174a4f 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -1,5 +1,5 @@ (( $+commands[npm] )) && { - __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion" + __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion" if [[ ! -f $__NPM_COMPLETION_FILE ]]; then npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null -- cgit v1.2.3-70-g09d2