hono
Hono
Hono is an ultrafast, lightweight web framework built on Web Standards that runs on Cloudflare Workers, Deno, Bun, AWS Lambda, Node.js, and other runtimes from a single codebase.
Documentation
Key Capabilities
Hono ships with extensive built-in middleware and helpers — no external packages needed for:
- Auth: Basic Auth, Bearer Auth, JWT, JWK (
hono/basic-auth,hono/bearer-auth,hono/jwt) - Security: CORS, CSRF, Secure Headers, IP Restriction (
hono/cors,hono/csrf,hono/secure-headers) - Performance: Compress, Cache, ETag, Body Limit, Timeout (
hono/compress,hono/cache,hono/etag) - Utilities: Logger, Request ID, Cookie helper, Streaming, WebSocket (
hono/logger,hono/cookie,hono/streaming,hono/websocket) - Rendering: JSX renderer, HTML helper, SSG (
hono/jsx,hono/html)
Best Practices
Validate header names in lowercase. Hono normalises incoming header keys to lowercase per the Fetch API spec. When accessing validated header values, always use lowercase keys (value['idempotency-key'], not value['Idempotency-Key']). Uppercase lookups silently return undefined.
Set Content-Type or validation silently passes empty objects. The built-in json() and form() validators only parse when the request Content-Type matches. A missing or wrong header causes the validator to receive {} and pass — no error is thrown. Always set Content-Type: application/json (or application/x-www-form-urlencoded) in tests and client calls.
Do not extract handlers into separate controller files. Unlike Express, Hono's path-parameter types are inferred from the route string at the call site. Moving handlers into separate files loses that inference without writing complex generics. Keep handlers inline with route definitions, or use factory.createHandlers() from hono/factory when separation is required.
More from mikkelkrogsholm/dev-skills
meilisearch
Meilisearch — fast, open-source search engine with typo tolerance, faceted search, and AI-powered hybrid search. Use when building with Meilisearch or asking about its index configuration, search parameters, filters, facets, API keys, geosearch, ranking rules, or integration with JavaScript/TypeScript clients. Fetch live documentation for up-to-date details.
42shadcn-ui
shadcn/ui — copy-owned React component library built on Radix UI and Tailwind CSS. Use when building with shadcn/ui or asking about its components, CLI, theming, configuration, or integration with Next.js, Vite, Remix, or other frameworks. Fetch live documentation for up-to-date details.
10zod
Zod — TypeScript-first schema validation with static type inference. Use when building with Zod or asking about schema definitions, type inference, parsing, transformations, refinements, coercion, error handling, or integration with forms, APIs, or tRPC. Fetch live documentation for up-to-date details.
10bun
Bun — fast all-in-one JavaScript/TypeScript runtime, package manager, bundler, and test runner. Use when building with Bun, running TypeScript, managing packages with bun install, writing tests with bun test, or asking about Bun APIs, configuration, or Node.js migration. Fetch live documentation for up-to-date API details.
9opentelemetry
OpenTelemetry — vendor-neutral observability framework for generating and collecting traces, metrics, and logs. Use when building with OpenTelemetry or asking about its JavaScript/Node.js SDK setup, auto-instrumentation, manual spans, exporters, context propagation, sampling, or integration with Jaeger, Zipkin, or OTLP collectors. Fetch live documentation for up-to-date details.
5playwright-cli
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
5