Hono is a lightweight, simple, and ultrafast web framework built entirely on Web Standards, enabling it to run consistently across various JavaScript runtimes including Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, AWS Lambda, Lambda@Edge, and Node.js. It features a high-performance router (`RegExpRouter`), zero external dependencies, and a small bundle size (under 12kB for `hono/tiny`). Hono emphasizes an excellent developer experience with clean APIs and first-class TypeScript support. The current stable version is 4.12.14, with frequent patch and minor releases addressing bugs, security, and new features. Its key differentiators include true multi-runtime compatibility, focus on Web Standards, and performance, making it an ideal choice for edge-first applications and serverless functions where cold starts and resource usage are critical.
npm install honoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic Hono application, showing how to define routes for GET and POST requests, respond with text and JSON, and serve it using `@hono/node-server` for Node.js environments.
Upgrade Hono to version 4.12.14 or later. Ensure all HTML output from `hono/jsx` SSR is sanitized if user input is directly used in attribute names.
Upgrade Hono to version 4.12.12 or later. Review static file serving configurations to ensure robust path validation.
Upgrade Hono to version 4.12.12 or later. Always ensure `toSSG()` output directories are tightly controlled and isolated.
Upgrade Hono to version 4.12.7 or later to mitigate prototype pollution risks when parsing request bodies.
Use appropriate runtime adapters for your deployment target. For Node.js, install and use `@hono/node-server` to integrate Hono's `fetch` API with the Node.js HTTP server.
Always consult the official Hono documentation for the correct import paths for middleware, JSX utilities, and runtime adapters. Do not assume all features are exported directly from the main `hono` package.
Ensure your project is configured for ESM by adding `"type": "module"` to your `package.json` or by using `.mjs` file extensions, and always use `import { Hono } from 'hono';`.Verify the exact import path from Hono's official documentation. For example, `logger` is imported from `hono/logger` (or `hono/logger/deno` for Deno).
Ensure your route handlers are correctly defined as `(c) => ...` and that `c` is the first argument, representing the Hono Context object. Verify you are not accidentally shadowing `c` or calling `c.text()` outside a valid handler scope.
No dependency data recorded yet.