Skip to content

Instantly share code, notes, and snippets.

@Drewlius
Created September 18, 2026 14:54
Show Gist options
  • Select an option

  • Save Drewlius/b87e876b8425510626d2e6c41fe20bd2 to your computer and use it in GitHub Desktop.

Select an option

Save Drewlius/b87e876b8425510626d2e6c41fe20bd2 to your computer and use it in GitHub Desktop.

Bun vs npm Quick Reference

Command What it does
npm Runs a local or global npm package's CLI, or manages dependencies (npm install)
npx Downloads (if needed) and runs a package's CLI without installing it globally. Also runs local node_modules/.bin bins.
bun Bun's equivalent of npm — installs dependencies, runs scripts, manages packages. Much faster.
bunx Bun's equivalent of npx — fetches and runs a package's CLI without permanent install.

TL;DR: bun ≈ npm, bunx ≈ npx. The x-variants are "execute this package's binary temporarily." Bun's versions are significantly faster because they skip the Node resolution overhead.

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