bun <file>runs TS/JSX directly — no build, no config, no .js emitted.
bun run <name>runs a package.json script; bare bun run lists them.
bunx = bun xrun a package binary, auto-installing to a shared cache (like npx, faster).
bun installnpm-compatible; writes bun.lock (text). Commit it; git-ignore node_modules.
--frozen-lockfileuse in CI for deterministic, no-re-resolve installs.
bun add -d / -E-d dev · --peer · --optional · -E exact pin.
--watch vs --hot--watch restarts the process; --hot live-reloads and keeps state.
bun:testtests import from bun:test — Jest-compatible, not jest itself.
bun build --compileemits a standalone executable (Bun runtime + your code).
.env auto-loadsno dotenv; use Bun.env / process.env; --env-file to override.
bun --bun run xforce a Node tool (vite, next…) onto Bun’s runtime via a node symlink.
batteries includedBun.serve, Bun.file, Bun.$, bun:sqlite, Bun.password — no installs.
no type-checkingBun erases types; run tsc --noEmit separately for safety.
JavaScriptCoreengine is Safari’s JSC, not V8 — ~99% Node API compat, not 100%.
bun pm migrateimport an existing package-lock.json / yarn.lock / pnpm-lock.
bun upgradeself-update the binary; pin Bun in CI (pre-2.0, minors can shift).