Skip to content

Instantly share code, notes, and snippets.

@danielbayley
Last active October 26, 2025 11:01
Show Gist options
  • Save danielbayley/62a3076902f664391b1cfbcd09d78918 to your computer and use it in GitHub Desktop.
Save danielbayley/62a3076902f664391b1cfbcd09d78918 to your computer and use it in GitHub Desktop.
A shim to seamlessly alias @npm to @pnpm.
#! /bin/zsh -f
if (command which -s pnpm) npm () {
case $@ in
*-g*) command npm $@;;
*) pnpm $@;;
esac
}
@omar391
Copy link

omar391 commented Jan 14, 2022

@danielbayley how do we use this file in windows?

@dangnhdev
Copy link

I'm a Linux newbie. Can you write a simple guide to use this file please?

@danielbayley
Copy link
Author

@omar391 @dangnhdev Sorry guys, I don’t use either platform (with the exception of Windows for occasional VR gaming…) macOS only I’m afraid. Also, this Gist is farily out of date! But some equivalent of this will have a place in my ZDOTDIR. PRs welcome if you manage to figure out improvements that don’t affect the behavior on macOS…

@martian17
Copy link

I use bash instead of zsh. I would like to use a bash version of this.

@loganpowell
Copy link

FYI, this broke my xcode-select installation on macbook air m1 silicon (ventura 13.3.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment