ScriptsApr 6, 2026·2 min read

Hono — Ultra-Fast Web Framework for Edge & AI APIs

Lightweight TypeScript web framework that runs on Cloudflare Workers, Deno, Bun, Vercel, and Node.js. 14KB, zero dependencies, 3x faster than Express. Perfect for AI API backends. 22,000+ stars.

SC
Script Depot · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

npm create hono@latest my-api
cd my-api && npm run dev
import { Hono } from "hono";

const app = new Hono();

app.get("/", (c) => c.text("Hello Hono!"));

app.post("/api/chat", async (c) => {
  const { message } = await c.req.json();
  const response = await fetch("https://api.anthropic.com/v1/messages", {
    method: "POST",
    headers: { "x-api-key": c.env.ANTHROPIC_API_KEY, "content-type": "application/json" },
    body: JSON.stringify({ model: "claude-sonnet-4-20250514", messages: [{ role: "user", content: message }] }),
  });
  return c.json(await response.json());
});

export default app;

Intro

Hono is an ultra-lightweight TypeScript web framework with 22,000+ GitHub stars that runs everywhere — Cloudflare Workers, Deno, Bun, Vercel Edge, AWS Lambda, and Node.js. At just 14KB with zero dependencies, it is 3x faster than Express and designed for edge computing where every millisecond and kilobyte matters. Perfect for building AI API backends, webhook handlers, and MCP server wrappers. Best for TypeScript developers building fast, portable APIs. Works with: any JavaScript runtime. Setup time: under 1 minute.


Why Hono

Performance

Framework Requests/sec Size
Hono 130,000 14KB
Express 45,000 200KB+
Fastify 75,000 100KB+
Koa 50,000 60KB+

Multi-Runtime Support

// Same code runs everywhere:
// - Cloudflare Workers
// - Deno
// - Bun
// - Node.js
// - Vercel Edge Functions
// - AWS Lambda
// - Netlify Edge

Middleware Ecosystem

import { cors } from "hono/cors";
import { jwt } from "hono/jwt";
import { logger } from "hono/logger";
import { cache } from "hono/cache";
import { compress } from "hono/compress";

app.use("*", cors());
app.use("*", logger());
app.use("/api/*", jwt({ secret: "my-secret" }));

AI API Pattern

import { Hono } from "hono";
import { stream } from "hono/streaming";

const app = new Hono();

app.post("/api/stream", async (c) => {
  return stream(c, async (stream) => {
    const response = await fetch("https://api.anthropic.com/v1/messages", {
      method: "POST",
      headers: { "x-api-key": c.env.API_KEY },
      body: JSON.stringify({ model: "claude-sonnet-4-20250514", stream: true, messages: [...] }),
    });
    for await (const chunk of response.body) {
      await stream.write(chunk);
    }
  });
});

RPC Mode (Type-Safe Client)

// Server
const route = app.get("/api/users/:id", (c) => c.json({ name: "Alice" }));

// Client (auto-typed)
import { hc } from "hono/client";
const client = hc<typeof route>("http://localhost:3000");
const res = await client.api.users[":id"].$get({ param: { id: "1" } });

Key Stats

  • 22,000+ GitHub stars
  • 14KB, zero dependencies
  • 7 runtime targets
  • 3x faster than Express
  • Built-in RPC type safety

FAQ

Q: What is Hono? A: Hono is an ultra-lightweight TypeScript web framework that runs on every JavaScript runtime — Cloudflare Workers, Deno, Bun, Node.js, and more — at 3x the speed of Express.

Q: Is Hono free? A: Yes, fully open-source under MIT license.

Q: Can I migrate from Express to Hono? A: Yes, Hono has similar routing syntax. Most Express middleware patterns have Hono equivalents.


🙏

Source & Thanks

Created by Yusuke Wada. Licensed under MIT.

hono — ⭐ 22,000+

Thanks for proving web frameworks can be tiny, fast, and universal.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets