In MacOS, you can create alias for long command for better typing and developing purposes!
In this post, you'll know how. In this instruction, we will do "pn" for "pnpm" command.
First, determine which shell you're using. Open your Terminal and run:
This will likely output either /bin/zsh (for Zsh, the default in recent macOS versions) or /bin/bash (for Bash).
Based on your shell, you'll need to edit the corresponding configuration file.
Add the following line to the end of the file:
After adding the line, save the file and exit the editor by pressing Ctrl + X, then Y, and finally Enter.
For the new alias to take effect, you can either close and reopen your Terminal or run the source command on your configuration file:
bash
source ~/.bash_profile
For Bash
Now, you can type pn in your terminal, and it will execute the pnpm command.