
ElysiaJS Has a Free Framework: End-to-End Type Safety at Bun Speed — 6x Faster Than Express
tRPC gives you type safety but locks you into its ecosystem. GraphQL gives you flexibility but adds schema complexity. REST gives you simplicity but zero type inference. What if your REST framework gave you tRPC-level type safety with Express-level simplicity, running at Bun speed? That's ElysiaJS. Quick Start bun create elysia app cd app && bun run dev End-to-End Type Safety // server.ts import { Elysia , t } from " elysia " ; const app = new Elysia () . post ( " /users " , ({ body }) => { // body is fully typed: { name: string, email: string } return { id : crypto . randomUUID (), ... body }; }, { body : t . Object ({ name : t . String (), email : t . String ({ format : " email " }), }), }) . get ( " /users/:id " , ({ params : { id } }) => { return { id , name : " Aleksej " , email : " dev@example.com " }; }) . listen ( 3000 ); export type App = typeof app ; // client.ts — automatic type inference import { treaty } from " @elysiajs/eden " ; import type { App } from " ./server " ; con
Continue reading on Dev.to JavaScript
Opens in a new tab



