talira

Backend TypeScript framework with end-to-end type safety, built for Bun

open sourceMITfree

Elysia is a backend TypeScript web framework built around Bun, with end-to-end type safety from one type system: route schemas (TypeBox, as Elysia.t) validate requests and give types to handlers, generated OpenAPI documentation and the Eden client, which calls your API from the frontend with full types, like tRPC. Handlers just return a string, JSON, a file or a generator for streaming, and WebSockets are built in. It has plugins, lifecycle hooks, macros, reactive cookies, OpenTelemetry tracing and a full-stack dev server, and also runs on Node.js, Deno and Cloudflare Workers. It's by SaltyAom.

Problems it solves

  • a fast TypeScript backend framework for Bun
  • share API types between my backend and frontend without code generation
  • validate request bodies and get OpenAPI docs from the same schema in TypeScript

Features

  • End-to-end type safety from route schemas to the Eden client
  • Request validation with TypeBox (Elysia.t)
  • OpenAPI documentation generated from routes
  • Return a string, JSON, a file or a generator to stream
  • Built-in WebSocket support
  • Plugins, lifecycle hooks and macros
  • OpenTelemetry tracing
  • Runs on Bun, Node.js, Deno and Cloudflare Workers

Alternatives

The same job

These do what Elysia does.

  1. Hono Web framework built on Web Standards
  2. tRPC End-to-end typesafe APIs made easy
  3. Fastify Fast and low overhead web framework, for Node.js
  4. Nitro Server toolkit that builds one codebase for Node.js, Bun, Deno, edge and serverless

Compare Elysia with the top 3