The first production ready,
and most loved Bun framework
Our Principle
Design for Human
Our goal is to design an ergonomic, sensible, and productive framework that even beginners can use easily
Designed to avoid unnecessary complexity and type complexity for you to focus on building
A framework that feels just like JavaScript
import { Elysia } from 'elysia'
new Elysia()
.get('/', 'Hello World')
.get('/image', Bun.file('mika.webp'))
.get('/stream', function* () {
yield 'Hello'
yield 'World'
})
.ws('/realtime', {
message(ws, message) {
ws.send('got:' + message)
}
})
.listen(3000)
The Next Level of Type Safety
import { Elysia } from 'elysia'
new Elysia()
.get('/id/:id', ({ params, set }) => {
set.headers.a
return 'Su'
})
.get('/optional/:name?', ({ params: { name } }) => {
return name ?? 'Pardofelis'
})
.listen(3000)
Your own documentation in 1 line
It's not magic
With deep integration with OpenAPI schema
Elysia can generate Swagger documentation for your API out of the box
import { Elysia } from 'elysia'
import swagger from '@elysiajs/swagger'
new Elysia()
.use(swagger())
.use(character)
.use(auth)
.listen(3000)
11.88ms
POST /character/:id/chat
Playback
For DevOps
OpenTelemetry
Elysia has 1st party support for OpenTelemetry. Instrumentation is built-in, so you can easily monitor your services on regardless of the platform.
import { treaty } from '@elysiajs/eden'
import type { App } from './server'
const api = treaty<App>('api.elysiajs.com')
const { data } = await api.profile.patch({
age: 21
})
For Frontend
End-to-end Type Safety
Like tRPC, Elysia provides type-safety from the backend to the frontend without code generation. Interaction between frontend and backend is type-checked at compile time.
21x
faster than Express
6x
faster than Fastify
Elysia Bun
2,454,631 reqs/sGin Go
676,019
Spring Java
506,087
Fastify Node
415,600
Express Node
113,117
Nest Node
105,064
Measure in requests/second. Result from TechEmpower Benchmark Round 22 (2023-10-17) in PlainText
Test with confidence
Type safe with auto-completion
Elysia provide a type-safe layer for interact and test your server from routes to parameters.
With auto-completion, you can easily write tests for server without any hassle.
import { treaty } from '@elysiajs/eden'
import { app } from './index'
import { test, expect } from 'bun:test'
const server = treaty(app)
test('should handle duplicated user', async () => {
const { error } = await server.user.put({ username: 'mika',
})
expect(error?.value).toEqual({
success: false,
message: 'Username already taken'
})
})
Powered by love
from the community
Aqueel
@AqueelMiq
Jetfuel on bun at X! @shlomiatar who built the framework has an eye for picking the right tools for the job.
Shlomi Atar
@shlomiatar
also a shoutout to @saltyAom and the phenomenal Elysia js that is powering our server driven UI. Incredible work.
htmx.org
@htmx_org
htmx works great w/ @bunjavascript, @elysiaJS and @tursodatabase btw
Marc Laventure
@MarcLaventure
both engineering+monetary contributions are paramount for OSS we proudly sponsor dozens of projects: @elysiaJS @LitestarAPI @honojs @daveshanley @kevin_jahns @MarijnJH & help maintain repos+contribute to OSS at blistering cadence. it's @scalar's ethos to be a catalyst for OSS
Jarred Sumner
@jarredsumner
You can use Express with Bun, but often we see people using Elysia, Hono, or Bun.serve() directly.
Runyasak Ch. 💚
@runyasak
Started using @elysiaJS to create a Discord Bot and found the type system beautifully easy. DX is fantastic and coding is fun! Use @DrizzleORM with PostgreSQL. So much easier than I've used before. ElysiaJS has proved to me that great performance and DX can live together. 😎
Herrington Darkholme
@hd_nvim
Was introduced to @elysiaJS today and it looks pretty solid. end-to-end type safety/guard/swapper are killer features of the modern web! (and it's fast)
scalar.com
@scalar
so excited to be part of the amazing @elysiaJS community!
José Donato 🦋
@josedonato__
handling tables with ~350k rows like it's nothing. Working on allowing @ag_grid server side row model when connecting a custom backend to @openbb_finance Terminal Pro. Backend in @elysiaJS + @bunjsproject.
pilcrowonpaper
@pilcrow
Just in time for Bun 1.0 - Lucia 2.5 now supports @elysiajs out of the box!! You can also use Bun.serve() directly as well. This release also comes with 2 new OAuth providers, Strava and AWS Cognito!
MikroORM
@MikroORM
I've been playing a bit with @bunjavascript and @elysiaJS, need to do a few more tweaks before the release, but next version should work more natively with bun when it comes to TS support detection, e.g. the CLI works without ts-node installed.
Made possible by you
Elysia is not own by an organization but is driven by the community.
Elysia development is only possible thanks to your support
Thank you for making Elysia possible
San Francisco Compute Company
for 3 months
Scalar
for a year
Jarred Sumner
for a year
_typedev
for a year
DOM CHAROENYOS
for 10 months
Naoki Takahashi
for 7 months
PandoSoft
for a month
Christian Rishøj
for a year
Khyber Sen
for 10 months
MeCode
for 10 months
yoyismee
for 10 months
Nemanja
for 9 months
kubilay
for 7 months
RiestelX
for 5 months
Sunghyun Cho
for 4 months
Sven Graziani
for 3 months
Huly® Platform™
for 3 months
Vallaris Maps Platforms
for 2 months
Firat Özcan
for 2 months
Speakeasy
for 8 hours
Thanatat Tamtan
for 2 years
Ronald Dijks
for 7 months
gabriel-peracio
for 3 months
Jittat Fakcharoenphol
for a year
[object Object]
for a year
Ajit Krishna
for a year
Louis Gentil
for a year
David L. Bowman
for 10 months
Ciro Spaciari
for 10 months
Kamil Jakubus
for 10 months
✦ freddie
for 9 months
Kira Kitsune
for 8 months
Ricardo Devis Agullo
for 8 months
Foxie Solutions
for 8 months
4ndrs
for 8 months
drsmile1001
for 6 months
Merlinz-dev
for 3 months
0xYok
for 3 months
Jason Dubaniewicz
for 3 months
Martini
for 2 months
Samir Bioud
for a month
Hadrian de Oliveira
for 7 days
Freek
for 3 months
Thinesh Rasla
for 12 days
Nutthapat Pongtanyavichai
for 2 years
Manassarn "Noom" Manoonchai
for 2 years
Phawit Pornwattanakul
for 2 years
Vorrapong Kertnat
for 2 years
First Sutham
for a year
Diego Ordoñez
for a year
stanley
for 10 months
Dominik Seger
for 10 months
Marcello
for 9 months
Hassadee Pimsuwan
for 8 months
Nayuki
for 8 months
Altin Thaci
for 8 months
白田 連大
for 7 months
Kyle
for 7 months
suchai-foundnerds
for 6 months
Chanon Mee-Iam
for 6 months
Surachet Sangasaeng
for 6 months
Nathan Chapman
for 5 months
Nikita
for 5 months
Yuzuki Aida
for 4 months
TAKZOBYE
for 3 months
S. Srisuk
for 3 months
l2D
for 3 months
Nopdanai Dejvorakul (孙贤德)
for 3 months
Alan Reis
for 3 months
Piti Pitiaunchamroen
for 3 months
Sergen Tanguc
for 2 months
Từ Thắng Phát
for 2 months
Yuzu
for 2 months
Nischal Dahal
for a month
hadth-rook
for 19 days
arda662
for 13 days
MikanDev
for 5 hours
And you
To summarize
Only the best
for the bold
For builders, inventors, and visionaries
We spent years studying the strengths and weaknesses of JavaScript frameworks, all to deliver an exceptional experience
At the speed of light
Up to 21x faster than Express
Supercharged by Bun,
Elysia is one of top performing JavaScript frameworks
Maximum Type Safety
Dynamic type safety
Built from type to runtime
Elysia learn from your codebase, adapt, enforce with your type
Productive in a reach
The best experience of today
Ergonomically designed for human, putting DX at the priority. No technical non-sense