TOOL

Node.js

Package management

Package

npmyarnpnpm
Initialize package.jsonnpm inityarn initpnpm init
Initialize from templatenpm init [initializer]yarn create [initializer]pnpm create [initializer]
Install from package.jsonnpm installyarn [install]pnpm install
Install new packagenpm install <package> [--global|--save-dev]yarn [global] add <package> [--dev]pnpm add <package> [--global|--save-dev]
Uninstall packagenpm uninstall <package> [--global]yarn [global] remove <package>pnpm remove <package> [--global]
Update packagenpm update [<package>] [--global]yarn [global] upgrade [<package>] [--latest]pnpm update [<package>] [--latest] [--global]

Project

npmyarnpnpm
Run scriptnpm run <script>yarn run <script>pnpm [run] <script>
Run testnpm testyarn testpnpm test
Create bundlenpm buildyarn buildpnpm build
Global bin directoryPREFIX + /binyarn global bin?
Global package directorynpm config set prefix ~/.npmyarn global dir?

Other

npmyarnpnpm
Run remotelynpxyarn dlxpnpm dlx

Pnpm

Override version of package/dependency (add to package.json):

json
{
  "pnpm": {
    "overrides": {
      "package": "version"
    }
  }
}