API Reference

Hono

Ultrafast web framework for Cloudflare Workers, Deno, Bun, and Node.js with type-safe routing and middleware.

Official Documentation ↗
CompatibilityThis documentation covers version v4.4. Check the official docs for the latest API surface.

Installation

npmnpm install hono
pnpmpnpm add hono

Methods

Hono is an ultrafast, lightweight web framework designed for edge runtimes. It provides type-safe routing, middleware support, and a small footprint (~14KB) that makes it ideal for Cloudflare Workers, Deno, and Bun deployments.

Key Features

  • Multi-runtime: Cloudflare Workers, Deno, Bun, Node.js
  • Type-safe routing: Path parameters are inferred at compile time
  • Tiny footprint: ~14KB minified, zero dependencies
  • Middleware: Built-in CORS, logger, JWT, bearer auth, pretty JSON
  • RPC mode: Type-safe client-server communication via hono/client
  • WebSocket: Built-in WebSocket support for real-time apps

FAQ

What runtimes does Hono support?
Hono runs on Cloudflare Workers, Deno, Bun, and Node.js (via @hono/node-server). The same code works across all runtimes with zero changes, making it ideal for edge deployment.
How fast is Hono?
Hono is one of the fastest web frameworks. On Cloudflare Workers, it handles requests in ~1ms overhead. On Bun, it benchmarks faster than Express, Fastify, and even native Bun.serve for complex routing.
Does Hono have built-in validation?
Yes, via @hono/zod-validator or @hono/valibot. These middleware validate request body, query, and headers using Zod or Valibot schemas, automatically returning 400 on invalid input.