Skip to content
These docs describe @green-tea/core 26.9.0-beta.1what changed. Install with npm i @green-tea/core@beta.
Green Tea

Green Tea.

A zen, opinionated, type-safe framework. Declare intent; green-tea derives the execution graph, validates it before traffic, and runs only what each route requires. Less infrastructure in your application. Less infrastructure in your head. 🍵

As an application grows, more of the day goes on remembering infrastructure: what runs first, what mutates the context, what was registered where, and which package owns which part of the request. None of that is your product.

green-tea moves that bookkeeping into the framework. You declare what each step needs and produces; it derives the order, validates the wiring at boot, runs only the slice each route requires — and prints the whole thing when you ask.

A graph, not a chain

Declare needs/provides; green-tea topologically sorts it. No ordering bugs, no positional guesswork — each route runs only its slice of the graph.

The type is the contract

In the typed flow core, a handler that reads ctx.user fails to compile if no step produces user. “It was undefined in prod” disappears at build time.

See the request before it runs

app.explain('/users/:id') prints the ordered chain; GET /__graph__ renders it as a live diagram. Onboarding and audits are reading, not archaeology.

One primitive for real-time

Declare @Sse, @Stream, or @Ws and return an AsyncIterable — the transport streams it (SSE, ndjson, or a WebSocket duplex) with backpressure and cleanup handled. No separate gateway.

Runs wherever JS runs

Node, Deno, Bun, and the edge — the same app, you only swap the entry point. HTTP, SSE, and WebSocket behave identically on all four.