เครื่องมือสร้างหน้าต่าง
เครื่องมือจัดการแพกเกจที่เร็วที่สุดในโลก
เริ่มทำงานเร็วกว่า Node.js 4 เท่า และทำงานได้เร็วขึ้นอย่างมากด้วยเอนจิน JavaScriptCore
รันไฟล์ TypeScript และ JSX ได้โดยตรงโดยไม่ต้องคอมไพล์ แปลงโค้ดทันทีขณะรัน
ติดตั้งแพ็กเกจ npm เร็วกว่า npm ถึง 30 เท่า ด้วย global cache และความเข้ากันได้เต็มรูปแบบ
bundle โปรเจกต์ JavaScript/TypeScript ในระดับมิลลิวินาที พร้อม code splitting, tree shaking และ minification
test runner ที่รวดเร็ว เข้ากันได้กับ Jest API รองรับ mocking, snapshots และ coverage
รันไทม์ bundler, transpiler, package manager และ test runner รวมอยู่ในไบนารีเดียว
# Install Bun
curl -fsSL https://bun.sh/install | bash
# Verify installation
bun --version
# Update Bun to latest version
bun upgradeเริ่มต้นอย่างรวดเร็ว (สร้างโปรเจกต์ใหม่):# Initialize new project
bun init
# Run TypeScript/JavaScript file
bun run index.ts
# Install dependencies
bun install
# Run with watch mode (hot reload)
bun --watch run index.tsรันโปรเจกต์ Node.js ที่มีอยู่:# Install dependencies (much faster than npm)
bun install
# Run with Bun runtime instead of Node
bun run start
# Or use as drop-in Node replacement
bun run dev
{
"scripts": {
"dev": "bun --watch run src/index.ts",
"build": "bun build src/index.ts --outdir dist",
"test": "bun test",
"start": "bun run dist/index.js"
}
}การ bundle ด้วย Bun:# Bundle for production
bun build ./src/index.ts --outdir ./dist --target browser
# Bundle with minification
bun build ./src/index.ts --outdir ./dist --minify
# Bundle for Node.js target
bun build ./src/index.ts --outdir ./dist --target nodeการทดสอบ:# Run all tests
bun test
# Run specific test file
bun test auth.test.ts
# Watch mode
bun test --watch
# With coverage
bun test --coverageตัวแปรสภาพแวดล้อม:.env โดยอัตโนมัติprocess.env หรือ Bun.envเริ่มต้นในไม่กี่นาที ด้วยกระบวนการติดตั้ง VPS แบบง่ายๆของเรา
จัดส่งในประมาณ2นาที • เข้าถึง root เต็มที่ • สนับสนุนโดยตั๋วและอีเมล