Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trystan2k/zsh-npm-plugin
A ZSH plugin to set custom NPM aliases. It's based (forked) from Oh-My-ZSH one.
https://github.com/trystan2k/zsh-npm-plugin
Last synced: about 2 months ago
JSON representation
A ZSH plugin to set custom NPM aliases. It's based (forked) from Oh-My-ZSH one.
- Host: GitHub
- URL: https://github.com/trystan2k/zsh-npm-plugin
- Owner: trystan2k
- License: mit
- Created: 2020-03-08T10:08:37.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-20T20:57:05.000Z (7 months ago)
- Last Synced: 2024-10-10T20:44:25.425Z (2 months ago)
- Language: Shell
- Homepage:
- Size: 70.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ZSH NPM Plugin
[![GitHub version](https://badge.fury.io/gh/trystan2k%2Fzsh-npm-plugin.svg)](https://badge.fury.io/gh/trystan2k%2Fzsh-npm-plugin)
![Build](https://github.com/trystan2k/zsh-npm-plugin/workflows/CI-workflow/badge.svg)
A zsh plugin that add NPM custom alias
This is completely based on [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/npm) NPM plugin.
## Installation
### Using [zinit](https://github.com/zdharma/zinit)
Add `zinit light trystan2k/zsh-npm-plugin` into `.zshrc`
### Using [zpm](https://github.com/zpm-zsh/zpm)
Add `zpm load trystan2k/zsh-npm-plugin` into `.zshrc`
### Using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
Execute `git clone https://github.com/trystan2k/zsh-npm-plugin ~/.oh-my-zsh/custom/plugins/zsh-npm-plugin`. Add `zsh-npm-plugin` into plugins array in `.zshrc`
### Using [antigen](https://github.com/zsh-users/antigen)
Add `antigen bundle trystan2k/zsh-npm-plugin` into `.zshrc`
### Using [zgen](https://github.com/tarjoilija/zgen)
Add `zgen load trystan2k/zsh-npm-plugin` into `.zshrc`
## Aliases
| Alias | Command | Descripton |
| :-------- | :-------------------------- | :-------------------------------------------------------------- |
| `npmg` | `npm i -g` | Install dependencies globally |
| `npmi` | `npm i` | Install dependencies locally |
| `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 |
| `npmlsg` | `npm list -g` | List installed packages globally |
| `npmlsg0` | `npm list -g --depth=0` | List top-level installed packages globally |
| `npmst` | `npm start` | Run npm start |
| `npmt` | `npm test` | Run npm test |
| `npmR` | `npm run` | Run npm scripts |
| `npmP` | `npm publish` | Run npm publish |
| `npmNew` | `npm init` | Run npm init |
| `npmclr!` | `rm -rf ./node_modules/` | Clear node_modules in current directory |
| `nre!` | `npmclr! && npmi` | Reinstall packages |
| `npmF` | `npm search` | Search in the npm database |