bun
JavaScript runtime and toolkit. Includes a bundler, a test runner, and a package manager.
More info →Subcommands (26)
Add and install new dependencies to the current project. Note: `a` can be used as an alias for `add`.
Check installed packages for known security vulnerabilities.
Bundle JavaScript and TypeScript files with Bun's fast native bundler.
This command is an alias of `bun create`.
Create a new project from a template. Note: `c` can be used as an alias for `create`.
Execute shell commands or script files using Bun's runtime. Note: When running from a shell, remember to escape quotes.
Send feedback to Bun.
This command is an alias of `bun install`.
Display package metadata from the npm registry.
Scaffold an empty Bun project.
Install JavaScript dependencies for a project from `package.json`.
Register a local package as linkable or link a registered package into a project. See also: `bun unlink`.
This command is an alias of `bun pm ls`.
List dependencies that have newer versions available.
Prepare a package for patching or generate a patch file.
A set of utilities for working with Bun's package manager. Some subcommands such as `pack`, `pkg` have their own usage documentation.
Publish a package to the npm registry.
Remove a dependency from `package.json`. Note: `rm` can be used as an alias for `remove`.
This command is an alias of `bun remove`.
Execute a JavaScript/TypeScript file, or a script from `package.json`.
Run tests using Bun's built-in test runner. It is a fast, Jest-compatible test runner that looks for `*.test.ts` (and similar) files.
Unregister the current directory as a linkable package. See also: `bun link`.
Update dependencies in a Bun project.
Upgrade Bun to the latest version.
Explain why a package is installed by showing its dependency chain.
This command is an alias of `bunx`.
Options (3)
booleanDownload and install all the packages listed as dependencies in `package.json`
bun {{[i|install]}}booleanAdd a dependency to `package.json`
bun {{[a|add]}} {{module_name}}booleanRemove a dependency from `package.json`
bun {{[rm|remove]}} {{module_name}}Examples (8)
Create a new Bun project in the current directory
Run a JavaScript file or a `package.json` script
bun run path/to/file|script_nameRun unit tests
Download and install all the packages listed as dependencies in `package.json`
bun [i|install]Add a dependency to `package.json`
bun [a|add] module_nameRemove a dependency from `package.json`
bun [rm|remove] module_nameStart a REPL (interactive shell)
bun replUpgrade Bun to the latest version