elysia
Elysia is a TypeScript web framework optimized for the Bun runtime that delivers exceptional performance and developer experience through end-to-end type safety…
Installation
npm install elysia
yarn add elysia
pnpm add elysia
Import
import { Elysia } from 'elysia';Quick Example
const app = new Elysia()
.get('/', () => 'Hello Elysia')
.get('/user/:id', ({ params }) => params.id)
.listen(3000);About elysia
Elysia is a TypeScript web framework optimized for the Bun runtime that delivers exceptional performance and developer experience through end-to-end type safety. Elysia achieves some of the highest HTTP benchmark scores among JavaScript frameworks by leveraging Bun's native HTTP server and optimized compilation. The framework features an innovative type system that infers request body, query parameters, headers, and response types automatically through a declarative schema system, ensuring type safety from route definition through response without manual type annotations. Elysia uses a plugin-based architecture where each plugin can extend types, add middleware, and register lifecycle hooks while maintaining full type inference. The framework includes built-in support for WebSockets, server-sent events, static file serving, and CORS. Elysia's schema validation uses TypeBox for compile-time and runtime type checking, generating OpenAPI documentation automatically from route definitions. The Eden plugin provides end-to-end type safety between server and client, similar to tRPC but integrated into the framework. Elysia is the recommended web framework for developers building high-performance APIs on Bun.
Quick Facts
| Package | elysia |
| Category | Framework |
| Weekly Downloads | 50K+ |
| License | MIT |
| Install | npm install elysia |
Related Packages
Hono is an ultrafast, lightweight web framework designed to run on any JavaScript runtime including …
Fastify is a high-performance web framework for Node.js designed to be the fastest HTTP framework av…
Express is the most widely used web application framework for Node.js, providing a minimal and flexi…
tRPC enables you to build fully typesafe APIs without schemas or code generation by leveraging TypeS…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.