npm-alias-cli
v1.0.0
Published
A CLI wrapper for npm with shortcuts and tab completion
Maintainers
Readme
npm-alias-cli
A lightweight CLI wrapper for npm with shortcuts and tab completion.
Installation
npm install -g npm-alias-cli
n completion install
source ~/.zshrcCustom Alias Name
To use a custom alias (e.g., np instead of n):
git clone https://github.com/bhawanishiv/npm-alias-cli.git
cd npm-alias-cli
npm install
./setup.sh np
source ~/.zshrcUsage
| Command | Description |
|---------|-------------|
| n | Show help |
| n <script> | npm run <script> (for dev, build, start, test) |
| n lint | npm run lint -- --fix --quiet |
| n r <script> | npm run <script> (any script) |
| n <cmd> [args] | npm <cmd> [args] |
Examples
# Run scripts
n dev # npm run dev
n build # npm run build
n start # npm run start
n test # npm run test
# Lint with auto-fix
n lint # npm run lint -- --fix --quiet
# Run any script
n r migrate # npm run migrate
n r custom-script # npm run custom-script
# npm commands
n i lodash # npm install lodash
n i -D typescript # npm install -D typescript
n un lodash # npm uninstall lodash
n outdated # npm outdatedTab Completion
Zsh completions for:
- Known scripts (dev, build, start, test, lint)
- npm commands (install, uninstall, update, etc.)
- Scripts from
package.json(aftern r)
n completion install # Install completion
n completion uninstall # Remove completionLicense
MIT
