Elysia is an ergonomic, high-performance TypeScript web framework built for Bun that delivers exceptional speed (255k+ requests/second), end-to-end type safety with automatic inference, and seamless integration with the Bun runtime. The framework combines a developer-friendly API with powerful features like automatic OpenAPI generation, lifecycle hooks, plugin architecture, and Eden Treaty for type-safe client-server communication—all while requiring minimal TypeScript boilerplate.
What This Cheat Sheet Covers
This topic spans 15 focused tables and 208 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Installation & Quick Start
Getting from nothing to a running server is famously short with Elysia—install Bun, scaffold a project, and you have a typed HTTP server listening on a port in a handful of lines. These entries cover that first stretch: installing the runtime, chaining your first routes, configuring the listener, and reading back the underlying Bun server so you know exactly what you've started.
| Feature | Example | Description |
|---|---|---|
curl -fsSL | bash | • JavaScriptruntime optimized for performance • required to run Elysia at full speed • Alternative: use with Node.js using polyfills | |
bun create elysia app | • Scaffolds new Elysia project with automatic setup • Navigate to directory with cd app after creation | |
import { Elysia } from 'elysia'new Elysia().get('/', 'Hello').listen(3000) | Minimal Elysia server listening on port 3000. Returns "Hello" for GET / requests. | |
bun dev | • Starts development server with hot-reload on file changes • Automatically restarts on code modifications | |
new Elysia() .get('/', 'Hello') .post('/user', ({body}) => body) .listen(3000) | • Chain multiple route handlers • Supports GET, POST, PUT, PATCH, DELETE, and custom HTTP methods |