Why ‘pnpm’ is a Tongue-Twister
Every damn time I write pnpm, I have to think about it for a second. I’m not sure if it’s because I’m not used to it, or if it’s because it’s just a weird word or if the fact that I have to type 2 ‘p’s in 4 letters what’s throwing me off. Either way, I’m tired of struggling to type it every time I need to use it in the CLI. So, I decided to rename it to something that’s easier to type. In this blog post, I’ll show you how to rename pnpm to anything your heart desires.
I renamed mine to just hh
. I’m not sure why, but I just like the way it sounds. It’s also easy to type, and I don’t have to think about it. I just type hh
and hit enter. It’s that simple.
How to Rename ‘pnpm’
Windows
- Create a new file in your home directory. I named mine
hh.bat
. - Copy the following code into the file:
@echo off
pnpm %*
- Save the file.
- Add the directory where you saved the file to your
PATH
environment variable or just throw it into yourC:\Windows\System32
directory.
Linux
- Create an alias for “pnpm” in your shell profile file (such as “.bashrc” or “.zshrc”). For example,
alias my-pnpm=“pnpm”.
- Create a symbolic link that points to the “pnpm” executable with a new name using the ln -s command. For example,
ln -s /usr/bin/pnpm /usr/bin/my-pnpm.
MacOS
- Create an alias for “pnpm” in your shell profile file (such as “.bash_profile” or “.zshrc”). For example,
alias my-pnpm=“pnpm”
- Create a symbolic link that points to the “pnpm” executable with a new name using the
ln -s
command. For example,
ln -s /usr/local/bin/pnpm /usr/local/bin/my-pnpm