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".
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.
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.
| Capability | Detail |
|---|---|
| Router | RegExpRouter (no linear loops) and TrieRouter, benchmarked against find-my-way, express, koa-router, koa-tree-router, trek-router, and @medley/router |
| JSX | hono/jsx with streaming, jsx-renderer middleware, and a client-side jsx/dom target |
| Middleware | Bearer auth, body-limit, IP restriction, combine, and more — all tree-shakeable entrypoints |
| Adapters | Cloudflare Workers, Deno, Bun, AWS Lambda, Lambda@Edge, Vercel, Fastly, Node.js |
| Preset | hono/tiny under 12kB, zero dependencies |
| Validation | First-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.
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.
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.
1 Edge API on Cloudflare Workers Edge / Serverless
Deploy a typed REST API to Cloudflare Workers with zero cold-start overhead. Use typed Bindings to access KV, R2, and Durable Objects directly from the context object — c.env.KV is typed, not any. Middleware like bearer-auth and ip-restriction compose cleanly without touching the handler.
2 Full-stack JSX app on Deno or Bun Full-stack / SSR
Hono's JSX layer and jsx-renderer middleware let you render server-side HTML with streaming support. The webapp component demonstrates this pattern. Since v4.4.0, Deno users import from JSR (jsr:@hono/hono) rather than deno.land/x — the migration is a one-line import change.
3 Multi-target library or middleware Library / OSS tooling
Because Hono ships ESM and CJS entrypoints and targets the Web Standard API, you can write middleware once and publish it as a third-party Hono middleware that works on every supported runtime. The contribution guide explicitly describes this path, and the ecosystem already includes packages like memoirist, radix3, and rou3 in the benchmark suite for comparison.
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- Clone the repository Run
git clone git@github.com:honojs/hono.git && cd honoto get a local copy. - 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. - Run the test suite Run
npm run test. This executestsc --noEmit(type-check) followed byvitest --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. - Start the webapp example Run
npm run start(ornpm run start:hono) to boot the example web application. You now have a live Hono server to inspect and modify. - Run a router benchmark Run
npm run bench:bun(ornpm 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. - 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.