← 返回命令列表

Linux command

bun 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Run

bun [script.js]

Install

bun install

Add

bun add [react]

Run

bun run [dev]

Create

bun create [react] [my-app]

Test

bun test

说明

bun is an all-in-one JavaScript runtime, package manager, bundler, and test runner. It's designed as a drop-in replacement for Node.js with significantly faster startup times and package installation. The tool aims to be a complete toolkit for JavaScript/TypeScript development with performance as a priority.

参数

run _file_
Execute JavaScript/TypeScript file
install
Install dependencies from package.json
add _package_
Add package to dependencies
remove _package_
Remove package
test
Run tests
build _file_
Bundle for production
create _template_
Create new project
upgrade
Upgrade Bun itself

FAQ

What is the bun command used for?

bun is an all-in-one JavaScript runtime, package manager, bundler, and test runner. It's designed as a drop-in replacement for Node.js with significantly faster startup times and package installation. The tool aims to be a complete toolkit for JavaScript/TypeScript development with performance as a priority.

How do I run a basic bun example?

Run `bun [script.js]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does run _file_ do in bun?

Execute JavaScript/TypeScript file