AgentSkillsCN

bun-development

采用 Bun 运行时进行现代 JavaScript/TypeScript 开发。涵盖包管理、打包构建、测试,以及从 Node.js 迁移的流程。当您需要使用 Bun、优化 JS/TS 开发速度,或从 Node.js 迁移到 Bun 时,可使用此技能。

SKILL.md
--- frontmatter
version: 4.1.0-fractal
name: bun-development
description: "Modern JavaScript/TypeScript development with Bun runtime. Covers package management, bundling, testing, and migration from Node.js. Use when working with Bun, optimizing JS/TS development speed, or migrating from Node.js to Bun."

⚡ Bun Development

Fast, modern JavaScript/TypeScript development with the Bun runtime, inspired by oven-sh/bun.

When to Use This Skill

Use this skill when:

  • Starting new JS/TS projects with Bun
  • Migrating from Node.js to Bun
  • Optimizing development speed
  • Using Bun's built-in tools (bundler, test runner)
  • Troubleshooting Bun-specific issues

1. Getting Started

🧠 Knowledge Modules (Fractal Skills)

1. 1.1 Installation

2. 1.2 Why Bun?

3. 2.1 Create New Project

4. 2.2 package.json

5. 2.3 tsconfig.json (Bun-optimized)

6. 3.1 Installing Packages

7. 3.2 Removing & Updating

8. 3.3 bunx (npx equivalent)

9. 3.4 Lockfile

10. 4.1 Basic Execution

11. 4.2 Watch Mode

12. 4.3 Environment Variables

13. 5.1 File System (Bun.file)

14. 5.2 HTTP Server (Bun.serve)

15. 5.3 WebSocket Server

16. 5.4 SQLite (Bun.sql)

17. 5.5 Password Hashing

18. 6.1 Basic Tests

19. 6.2 Running Tests

20. 6.3 Matchers

21. 6.4 Mocking

22. 7.1 Basic Build

23. 7.2 Build API

24. 7.3 Compile to Executable

25. 8.1 Compatibility

26. 8.2 Common Migration Steps

27. 8.3 Differences from Node.js

28. 9.1 Use Bun-native APIs

29. 9.2 Use Bun.serve for HTTP

30. 9.3 Bundle for Production