CodeVetter · Repo Unpack · Feature catalog
elysiajs/elysia
The developer-facing surface centers on typed routing, validation and lifecycle control. Applications can share context and state, manage cookies, compose plugins and mount other fetch handlers. Response facilities cover ordinary values, files, streams and SSE, with Bun-specific WebSockets. These are framework APIs demonstrated by tests and examples, rather than product screens or application-specific endpoints.
- get and post register method-specific routes; route uppercases arbitrary method names, and add applies prefixes and distinguishes literal paths from parameter/wildcard paths.
- Route schemas cover body, headers, params, query, cookie and status-dependent responses; Standard Schema tests demonstrate Zod validation and numeric query coercion.
- Built-in body parsing supports JSON, text, URL encoding, ArrayBuffer and multipart forms; multipart parsing groups repeated values and reconstructs dotted/indexed nested fields.
- Lifecycle hooks can transform context before validation, derive or resolve request properties, and intercept handling; tracing exposes request through error stages with timing and completion listeners.
- state supports named values, object merges and store-mapping functions; decorate adds reusable context members, and the counter example mutates shared state on GET /.
- Cookie objects expose values and attributes plus update, set and remove operations; parsing supports selected or all signed cookies and verification against rotated signing keys.
- Bun WebSocket routes support connection callbacks, parsed/validated messages and response validation; ElysiaWS exposes send, subscription and publish facilities.
- Response mapping handles JSON objects, strings, custom statuses, Response, files and streams; shared helpers implement byte ranges and SSE formatting, while use/group/guard/mount compose application behavior.