What problem does it solve?
This Skill provides expert knowledge of Bun's native runtime APIs, enabling developers to build high-performance server-side applications, HTTP APIs, and handle file operations with unparalleled speed. It addresses the need for faster execution and simpler native integrations compared to Node.js.
Core Features & Use Cases
- High-Performance Servers: Build HTTP and WebSocket servers using
Bun.serve, capable of handling millions of requests per second, significantly faster than Node.js alternatives.
- Efficient File I/O: Perform optimized file operations with
Bun.file and Bun.write, leveraging system-level optimizations for faster read/write speeds.
- Native Integration: Utilize the Foreign Function Interface (FFI) to call native C libraries directly, manage child processes, and integrate with Bun-specific utilities like
Bun.password for hashing.
- Use Case: "I want to build a REST API with Bun. Show me how to set up a
Bun.serve HTTP server with basic routing for /users and /products endpoints."
Quick Start
Create a simple HTTP server using Bun.serve that listens on port 3000 and responds with "Hello from Bun!" to all requests.