An independent explainer for honojs's hono — built to help you actually implement it.

source github.com/honojs/hono

hono
Web framework built on Web Standards

Hono: ultrafast, multi-runtime web framework for the edge and beyond

Hono is a small, precise, and ruthlessly fast web framework that runs identically on Cloudflare Workers, Fastly Compute, Deno, Bun, AWS Lambda, Lambda@Edge, and Node.js. One codebase, every platform — built entirely on the Web Standard API with zero dependencies and a router engineered to avoid linear loops.

702 public symbols. 7 focused components. One install command. Benchmarked against the field.

An independent explainer for honojs's hono — built to take you from "never seen it" to "ready to implement".

Language TypeScriptEcosystem npmPreset size hono/tiny under 12kBDependencies Zero
hono: A single flame threads itself through every wire on a glowing switchboard — arriving instantly, burning nothing, illuminating every runtime at once.
A single flame threads itself through every wire on a glowing switchboard — arriving instantly, burning nothing, illuminating every runtime at once.
01

Every runtime has its own rules. Your router shouldn't.

Why does this exist?

The JavaScript server ecosystem is fragmented: Cloudflare Workers, Deno, Bun, AWS Lambda, and Node.js each demand their own idioms, adapters, and deployment pipelines. Most frameworks pick one and call it done.

You end up maintaining parallel codebases, learning platform-specific quirks, or accepting a heavyweight abstraction that papers over the differences without truly solving them. The result is slower iteration, larger bundles, and routers that scan routes in linear loops — every request paying the tax of every route you've ever registered.

What you actually want is a single, expressive API that compiles once and deploys everywhere, backed by a router that was designed from the start to be fast — not retrofitted.

The problem hono: the problem
02

A web framework that lives where the Web Standard API lives

What does it actually do?

Hono is a web framework built entirely on the Fetch API, Request, Response, and the rest of the Web Standard surface. That's not a marketing claim — it's the architectural decision that makes multi-runtime deployment possible without shims or platform locks.

The core ships with built-in middleware, a JSX layer, streaming helpers, an SSG helper, and first-class TypeScript support — including typed route parameters, typed environment bindings for Cloudflare Workers, and typed context variables. The knowledge base indexes 702 public symbols across 7 components, so the surface is large enough to be complete and small enough to learn.

The big idea Hono routes a single request through typed middleware to a standard Response, on any JS runtime.
What ships in the box
CapabilityDetail
RouterRegExpRouter (no linear loops) and TrieRouter, benchmarked against find-my-way, express, koa-router, koa-tree-router, trek-router, and @medley/router
JSXhono/jsx with streaming, jsx-renderer middleware, and a client-side jsx/dom target
MiddlewareBearer auth, body-limit, IP restriction, combine, and more — all tree-shakeable entrypoints
AdaptersCloudflare Workers, Deno, Bun, AWS Lambda, Lambda@Edge, Vercel, Fastly, Node.js
Presethono/tiny under 12kB, zero dependencies
ValidationFirst-party validator entrypoint; recommended to pair with Zod or TypeBox for schema validation
03

The router is the product

Why is it elegant?

Most framework benchmarks measure middleware overhead. Hono's benchmark suite measures the router itself — route registration, parameter extraction, and dispatch — against the most commonly used alternatives in the ecosystem.

RegExpRouter compiles your route table into a single regular expression rather than iterating handlers one by one. That means route-count stops being a performance variable. The benchmark suite in the repo tests against find-my-way, express, koa-router, koa-tree-router, trek-router, and @medley/router — run them yourself with npm run bench:node or npm run bench:bun and read the numbers directly.

HTTP-level benchmarks are also automated: every pull request runs a bombardier-based benchmark comparing the current branch against main, and results are posted as a PR comment. The performance contract is visible in the repository's own CI, not just in a README table.

The aha Hono's router is built purely on Web Standard APIs with no dependencies, keeping the core under 12 kB.

When your router doesn't loop, adding routes doesn't cost you latency.

04

Seven components, one coherent system

How is it built?

The repository is organized into seven components — hono (core), routers, jsx, query-param, utils, webapp, and hono-benchmark — with explicit internal dependency edges: jsx depends on hono, webapp depends on hono.

The core Hono class accepts generic type parameters for Variables and Bindings, giving you typed access to c.get()/c.set() and Cloudflare environment bindings like KVNamespace and R2Bucket at the call site — no casting required. Routes chain with middleware in a way that preserves those types end-to-end.

Middleware and adapters are exposed as separate package entrypoints (e.g. hono/bearer-auth, hono/aws-lambda, hono/bun) with matching ESM and CJS outputs, so bundlers only include what you import. The build pipeline produces both dist/index.js (ESM) and dist/cjs/index.js (CJS) alongside full type declarations under dist/types.

Architecture Seven components — hono core, routers, jsx, query-param, utils, webapp, and benchmarks — where jsx and webapp depend on hono core, and the router layer plugs in RegExpRouter or TrieRouter interchangeably.
Architecture — modules, components and how they depend on each other.
Data flow At runtime, an incoming request hits the RegExpRouter, traverses the middleware chain in order, reaches the route handler, and returns a Web-standard Response — identically across Cloudflare Workers, Bun, Deno, Node, AWS Lambda, and Fastly Compute.
Data flow — how a request moves through the system at runtime.
05

Where Hono earns its keep

Could I use this?

Because Hono runs on Web Standard APIs, the same application code is valid in radically different deployment contexts. Here are three representative shapes.

In the real world hono in use
06

From zero to running in under two minutes

How do I start?

The repo uses Bun as its primary toolchain. You will need Bun v1.0+ installed. For the HTTP benchmarks you will also need bombardier (brew install bombardier on macOS).

bun install --frozen-lockfile
  1. Clone the repository Run git clone git@github.com:honojs/hono.git && cd hono to get a local copy.
  2. Install dependencies Run bun install --frozen-lockfile. Bun resolves and installs all workspace dependencies from the lockfile — you will see a summary of installed packages with no network variance.
  3. Run the test suite Run npm run test. This executes tsc --noEmit (type-check) followed by vitest --run. A passing run prints a vitest summary table showing test counts and durations per file — that's your signal everything is wired up correctly.
  4. Start the webapp example Run npm run start (or npm run start:hono) to boot the example web application. You now have a live Hono server to inspect and modify.
  5. Run a router benchmark Run npm run bench:bun (or npm run bench:node) inside the routers component. Results print a comparison table of Hono RegExpRouter and TrieRouter against find-my-way, express, koa-router, koa-tree-router, trek-router, and @medley/router — read the numbers directly from your machine.
  6. What you have at the end A fully type-checked Hono workspace, a passing test suite across the core and middleware, a running example server, and benchmark baselines on your own hardware. From here, scaffold a new project with npm create hono@latest.
07

Take the knowledge base with you

Does my AI get it too?

The Hono repository has been indexed into a 384-dimensional RVF knowledge base: 1035 passages covering 702 public symbols, 7 components, and 40 entrypoint commands. Download the pack to query Hono's API, middleware signatures, router internals, and migration history offline — without grepping source files.

# hono-knowledge-pack.zip for-ai/ # wire this into your agent hono-kb.rvf # 384-dim vector brain (semantic search) hono-kb.passages.jsonl # full passage text (search returns TEXT) hono-symbols.json # exact public API hono-dep-graph.json # what depends on what hono-entrypoints.json # build / test / run commands ask-kb.mjs · kb-mcp-server.mjs # CLI + MCP search server for-humans/ # read first hono-primer.md # the human orientation
Download the knowledge packRVF vector KB + MCP server — drop it into your own agent.
Give your AI the same understandinghono-knowledge-pack.zip