A fast, lightweight proxy for Node.js package managers that works across npm, yarn, pnpm, and bun. It provides smart shortcuts for common commands and seamless integration with your shell.
- Universal Package Manager Support: Works with
npm,yarn,pnpm, andbunwithout any configuration. - Smart Shortcuts: Quickly run common commands like install, add, remove, and run scripts with minimal typing.
- Automatic Tool Detection: Automatically uses tools like
tazefor outdated checks andnpkillfor cleaningnode_modulesif they are installed. - File Execution: Directly execute JavaScript, TypeScript, and Python files with appropriate runtimes.
You can download the latest release from the releases page. Or use one of the following methods:
sh -c "$(curl -fsSL jcwillox.com/l/node-alias)"Windows
iwr -useb jcwillox.com/l/node-alias-ps1 | iexThe power of node-alias comes from setting up shell aliases. At minimum, set up the n alias:
Bash/Zsh/Fish:
alias n="node-alias"You can also add additional shorthands to save even more characters:
alias ni="node-alias install"
alias nr="node-alias run"
# alias just for bun pkg manager
alias b="NODE_ALIAS_MANAGER=bun node-alias"PowerShell:
New-Alias n node-alias.exeOnce set up, you can use n instead of typing out your full package manager command!
Using the n alias, you can run package manager commands quickly:
n install # Install dependencies
n i # Same as install
n add lodash # Add a dependency
n a lodash # Same as add
n a -d lodash # Add a dev dependency and save exact version
n remove lodash # Remove a dependency
n rm lodash # Same as remove
n list # List installed packages
n ls # Same as list
n run dev # Run a npm script
n r dev # Same as runnode-alias includes intelligent shortcuts that automatically run the right tool:
-
n o– Check for outdated packages- Uses taze if available, otherwise falls back to the package manager's outdated command
-
n k– Clean up node_modules- Uses npkill if installed, otherwise forwards the command line to the package manager
node-alias can also directly execute Node.js files, and figure out the right runtime to use.
n script.js # Run any .js file
n script.ts # Run TypeScript files (using tsx or bun if available, or node if supported)And Python files:
n script.py # Run Python (using uv or python)node-alias automatically detects your project's package manager (npm, yarn, pnpm, or bun) and uses the correct one. You can also manually override it:
# Use bun explicitly
b install # Uses bun (requires `alias b="NODE_ALIAS_MANAGER=bun node-alias"`)node-alias provides intelligent completions for multiple shells, for linux packages (deb, rpm, apk) these are built-in. Otherwise, up-to-date copies are located in the completions/ directory.
You can also generate them yourself with the following command:
node-alias completion [bash|zsh|fish|pwsh]You can write this to a file then source it in your shell configuration.