Skip to content

Instantly share code, notes, and snippets.

@timkinnane
Created September 25, 2022 04:45
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 timkinnane/76ed980896185de75cda4c5921570f88 to your computer and use it in GitHub Desktop.
Save timkinnane/76ed980896185de75cda4c5921570f88 to your computer and use it in GitHub Desktop.
Shell alias for PNPM install, including workspace filters.
alias p="pnpm add"
alias pf="pnpm add --filter"
alias pd="pnpm add -D"
alias pdf="pnpm add -D --filter"
alias pi="pnpm i"

Shell alias for PNPM install

I find pnpm arguments a bit cumbersome, especially for filtering by workspace.

These simple command aliases make installing dependencies super simple.

They work best with command line tab completion installed.

Usage

  • Install dependency p package-name
  • Install dependency to workspace (filter) pf @my-workspace/my-package package-name
  • Install dev dependency pd package-name
  • Install dev dependency to workspace (filter) pdf @my-workspace/my-package package-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment