CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

elysiajs/elysia

Scanned commit e037eca710 dated 2026-08-26 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/elysiajs/elysia ↗ · 270 files · 1.9 MB

Elysia Ergonomic Framework for Humans Documentation | Discord | Sponsors TypeScript with End-to-End Type Safety, type integrity, and exceptional developer experience.

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (408s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

Elysia is a TypeScript HTTP and WebSocket framework for developers building typed server APIs, distributed here as the elysia npm package at version 1.4.30. Its central Elysia class combines fluent route registration, runtime schemas, lifecycle hooks and plugins with generated request handlers and a separate dynamic execution path. Bun supplies native serving and WebSockets, while Web Standard and experimental Cloudflare adapters expose alternative runtime boundaries.

System map

The public Elysia class owns application configuration, routes, schemas, hooks and shared state. Execution divides between generated AOT handlers and a dynamic handler, with adapters supplying serving and response behavior. Storage in the inspected framework core consists of application memory and HTTP cookies. Packaging and CI target multiple module formats and runtime integrations.

Feature catalog

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.

Data flow

Registration converts developer declarations into route records and execution machinery before requests arrive. Requests enter through Fetch-compatible Request objects and acquire per-request context alongside shared application state. Parsing and schema providers transform boundary values before application handlers run. Responses cross adapter mapping, cookie serialization, streaming or WebSocket output boundaries.

Behavior traces

The inspected flows cover server startup, request validation and cookie persistence across HTTP boundaries. Additional traces follow shared counter state, native constant responses, WebSockets and file ranges. Execution order includes early returns and adapter-specific conditions. These walkthroughs describe source behavior and test intent; they are not recorded runtime executions.

Testing signals

Tests and CI were inspected, not executed; no passing result is asserted. Bun tests exercise request behavior and regressions, while a separate TypeScript project checks public inference. Node and Cloudflare scripts provide integration smoke checks with narrower assertions. The inspected inventory is bounded, and commented tests identify local coverage limits without establishing repository-wide absence.

Risk map

The main sensitive boundaries are generated code, cookie signatures, validation output, filesystem reads and WebSocket validation. Native static routing introduces a separate execution boundary that existing guards and regressions explicitly protect. Several implementation differences merit targeted investigation across runtimes and AOT modes. These are source observations or labeled hypotheses, not confirmed vulnerabilities.

Extension points

Extensions attach through explicit adapter, plugin, hook, parser, macro and model surfaces. The core owns registration and schema composition, while adapters supply execution literals and output handlers. Context additions and mounted fetch applications support application integration without replacing the framework. Public type inference accompanies these runtime extension contracts.

Contributor handoff

This brief is pinned to e037eca710e7ad193be09cc6615ab0dbe54af914 and comes from bounded public-source inspection of more than twelve source files. Tests and CI were inspected, not executed, and test existence does not establish passing behavior. Future edits should preserve execution parity, adapter boundaries and public inference. Repository contribution policies and script side effects need attention before moving beyond read-only analysis.

Languages

LanguageFilesShare of source
TypeScript23799%
JSON8docs/config
Markdown7docs/config
YAML7docs/config
JavaScript21%
HTML1docs/config

Start reading here

Probable source entrypoint: src/index.ts — inferred from the directory tree and manifest, not the upstream docs.

Source roots

src/ (39 files)

Source layout — src/

PathFiles
src/adapter/10
src/type-system/4
src/universal/7
src/ws/3
src/compose.ts1
src/context.ts1
src/cookies.ts1
src/dynamic-handle.ts1
src/error.ts1
src/formats.ts1
src/index.ts1
src/manifest.ts1
src/parse-query.ts1
src/replace-schema.ts1

Repository structure

Top-level pathFiles
test/160
example/45
src/39
.github/8

Docs found: CONTRIBUTING.mdREADME.md

Package

package.json — elysia v1.4.30, 25 declared dependencies.

@elysiajs/openapi@sinclair/typebox@types/bun@types/cookie@types/fast-decode-uri-component@typescript-eslint/eslint-plugin@typescript-eslint/parserarktypecookieesbuild-fix-imports-plugineslinteslint-plugin-security

CI & config entrypoints

Structural health signals

Average score 8.3/10 across 96 analyzed source files; 4 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history