Bun Flags & Options
JavaScript runtime, bundler and package manager.All Bun pages
- bun --env-file: choose which .env file Bun loadsBun loads .env, .env.NODE_ENV and .env.local automatically; bun --env-file=FILE replaces that list with your file. Precedence, expansion and pitfalls explained.
- bun install --production: skip devDependenciesbun install --production installs dependencies without devDependencies. Combine with --frozen-lockfile in Docker; --omit=dev, bunfig.toml and pitfalls.
- bun run --bun: run package scripts and CLIs with Bun instead of Node.jsbun run --bun runs package scripts and node-shebang CLIs such as vite on the Bun runtime instead of Node.js. bunx --bun, bunfig.toml run.bun and when not to.
- bun test --coverage: code coverage table and lcov reportbun test --coverage prints % Funcs and % Lines per file with uncovered lines; --coverage-reporter=lcov writes lcov.info. Thresholds in bunfig.toml and caveats.