Favicon of hono

hono

Lightweight web framework built on Web Standards APIs, running unchanged on Cloudflare Workers, Deno, Bun, Node.js, AWS Lambda, and more.

Hono is a small, simple web framework built on Web Standards APIs, designed to run unchanged across JavaScript runtimes: Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, AWS Lambda, Lambda@Edge, and Node.js. It's aimed at developers building APIs and web services who want a single framework that works the same way regardless of where the code ends up running, from an edge function to a traditional Node server.

Key features

  • Ultrafast routing: Hono's RegExpRouter avoids linear loops for route matching, keeping request routing fast even as the number of routes grows.
  • Lightweight: The hono/tiny preset is under 12kB, and Hono has zero dependencies, relying only on Web Standard APIs rather than runtime-specific abstractions.
  • Multi-runtime by design: The same application code runs on Cloudflare Workers, Fastly Compute, Deno, Bun, AWS Lambda, Lambda@Edge, or Node.js without modification.
  • Built-in and third-party middleware: Hono ships with built-in middleware and supports custom and third-party middleware, so common concerns like logging, CORS, or authentication don't need to be built from scratch.
  • First-class TypeScript support: The API is designed around clean, typed handlers, with strong TypeScript support built in rather than bolted on.
  • Multiple router strategies: Beyond RegExpRouter, Hono includes SmartRouter, LinearRouter, and PatternRouter, giving different tradeoffs depending on the application's routing needs.

Ideal use cases

Hono fits building APIs or web services intended to run at the edge, such as on Cloudflare Workers or Vercel Edge Functions, where a small bundle size and low cold-start overhead matter. Because the same code runs across so many runtimes, it also suits teams that want to avoid locking their API layer into one specific hosting platform, or that need to move a service between, say, AWS Lambda and a traditional Node.js server without a rewrite. Its middleware system and TypeScript-first design make it a reasonable choice for typical REST or RPC-style API work more broadly, not just edge-specific cases.

It's less of a fit if you need a full-stack framework with built-in templating, ORM, or admin scaffolding baked in; Hono is focused specifically on the web framework layer (routing, middleware, request/response handling), so you'd pair it with other libraries for a complete application. If your project is committed to a single runtime already and you rely heavily on that runtime's non-standard APIs, the cross-runtime portability may matter less to you, though the smaller footprint and fast router can still be worth it on their own.

Installation

Add Hono to a project with your package manager of choice, or scaffold a new project directly:

npm create hono@latest

The scaffolding tool walks through selecting a target runtime and sets up a working starter project for it.

A minimal Hono application looks like this:

import { Hono } from 'hono'
const app = new Hono()

app.get('/', (c) => c.text('Hono!'))

export default app

The exported app is the entry point your runtime expects, whether that's a Cloudflare Worker, a Bun server, or a Node.js adapter.

Full documentation, including guides for each supported runtime and available middleware, is available at hono.dev. If you're upgrading between versions, a dedicated migration guide is maintained in the repository's docs directory.

To contribute, the project welcomes new issues for bugs or feature proposals, pull requests for fixes and refactors, and third-party middleware packages built for the ecosystem; contribution details are documented in docs/CONTRIBUTING.md.

Hono is maintained by Yusuke Wada, with its router implementations (RegExpRouter, SmartRouter, LinearRouter, and PatternRouter) credited to Taku Amano. Community discussion happens on the project's Discord server and on X, and the project's own DeepWiki page provides an additional way to explore the codebase and its structure.

Categories:

Frequently asked questions

Share:

Stars
31.3K
Forks
1.2K
Last commit
2 days ago
Repository age
5 years
License
MIT
Self-hosted
No
Activity score
82/100
View Repository
Built with:

Similar to hono

Favicon

 

  
  
Favicon

 

  
  
Favicon