Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.
npm / pnpm / yarn
Install, run, and publish Node packages - npm, with pnpm and yarn equivalents.| Command | What it does | Example |
|---|---|---|
npm init | Create a package.json. | npm init -y |
npm install | Install everything listed in package.json. | npm install |
npm install <pkg> | Add a runtime dependency. | npm install express |
npm install -D | Add a dev-only dependency. | npm install -D vitest |
npm install -g | Install a package globally. | npm install -g pnpm |
npm uninstall | Remove a dependency. | npm uninstall lodash |
npm run | Run a script defined in package.json. | npm run build |
npm test | Run the test script. | npm test |
npx | Run a package without installing it first. | npx create-vite@latest myapp |
npm ci | Clean, reproducible install from the lockfile. | npm ci |
npm update | Update dependencies within their version ranges. | npm update |
npm outdated | List dependencies that have newer versions. | npm outdated |
npm ls | Show the installed dependency tree. | npm ls --depth=0 |
npm version | Bump the version and create a git tag. | npm version patch |
npm publish | Publish the package to the registry. | npm publish --access public |
pnpm | Faster, disk-efficient npm alternative. | pnpm add express |
yarn | Another popular package manager. | yarn add express |