Skip to content

Instantly share code, notes, and snippets.

@beenotung
Last active June 24, 2021 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beenotung/92559fcd80e9b72d6279fb579c083625 to your computer and use it in GitHub Desktop.
Save beenotung/92559fcd80e9b72d6279fb579c083625 to your computer and use it in GitHub Desktop.
proxy npm to call pnpm
#!/bin/bash
set -e
set -o pipefail
case "$1" in
i|install)
shift
case "$1" in
-g|--global)
shift
npx --no npm i -g $@
exit $?
;;
esac
echo >&2 original: npm $@
echo >&2 mapto: pnpm install $@
pnpm install $@
exit $?
;;
esac
npx --no npm "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment