Framework50K+/wkMIT

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
npm install elysia
yarn
yarn add elysia
pnpm
pnpm add elysia

Import

ESM
import { Elysia } from 'elysia';

Quick Example

usage
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

Packageelysia
CategoryFramework
Weekly Downloads50K+
LicenseMIT
Installnpm install elysia

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.