Features
- End-to-end type safety with Eden connector
- Compile-time code generation for maximum performance
- Built-in validation with TypeBox integration
- OpenAPI/Swagger documentation auto-generation
Pros
- Best-in-class TypeScript DX with type inference
- Outstanding performance on Bun runtime
- Automatic API documentation from type definitions
Cons
- Tightly coupled to Bun runtime
- Smaller community and plugin ecosystem
- Rapid API changes in early versions
Overview
Elysia is a TypeScript-first web framework designed specifically for the Bun runtime, prioritizing developer experience and performance. It uses compile-time code generation and Bun’s native APIs to achieve exceptional throughput, consistently ranking among the fastest JavaScript web frameworks.
Elysia’s standout feature is its end-to-end type safety through the Eden connector, which allows frontend clients to consume API routes with full type inference without code generation. Combined with built-in TypeBox validation, you get runtime validation and TypeScript types from a single schema definition.
When to Use
Choose Elysia when building APIs on Bun where type safety and performance are priorities. It’s ideal for full-stack TypeScript projects where end-to-end type inference between server and client eliminates the need for separate API schema definitions.
Getting Started
bun create elysia my-app
cd my-app && bun run dev
import { Elysia } from "elysia";
const app = new Elysia()
.get("/", () => ({ message: "Hello from Elysia" }))
.listen(3000);