# h3js/h3

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/h3js-h3).**

5,353 stars · 336 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/h3js/h3
- Homepage: https://h3.dev
- awesome-repositories: https://awesome-repositories.com/repository/h3js-h3.md

## Description

Hono is a minimal JavaScript HTTP framework designed for building web servers across multiple runtimes, including Node.js, edge runtimes, and serverless platforms. It functions as a cross-runtime web server and a web standard API wrapper, normalizing various runtime request and response objects into standard Web API signatures.

The project serves as an HTTP middleware orchestrator and request handler, utilizing a middleware-based request pipeline and hierarchical route mounting to create modular server structures. It distinguishes itself through a runtime-agnostic event wrapper that ensures consistent behavior regardless of the deployment environment.

The framework covers a broad range of capabilities, including HTTP request routing with dynamic parameter capture, real-time WebSocket communication, and comprehensive security measures such as CORS management and basic authentication. It also provides utilities for session management via cookies, static asset serving, and traffic management through request proxying and URL redirection.

The project is implemented in TypeScript.

## Tags

### Software Engineering & Architecture

- [Runtime Agnostic Architectures](https://awesome-repositories.com/f/software-engineering-architecture/runtime-agnostic-architectures.md) — Uses a runtime-agnostic event wrapper to ensure consistent server behavior across Node.js, Deno, Bun, and edge runtimes.
- [Context Sharing](https://awesome-repositories.com/f/software-engineering-architecture/context-sharing.md) — Stores and retrieves arbitrary metadata to pass information between different event handlers. ([source](https://h3.dev/raw/guide/api/h3event.md))
- [Request Context State](https://awesome-repositories.com/f/software-engineering-architecture/request-context-state.md) — Provides request-scoped storage to share arbitrary metadata between middleware hooks and request handlers.
- [Application Logic Extensions](https://awesome-repositories.com/f/software-engineering-architecture/core-logic-extensions/application-logic-extensions.md) — Allows injecting reusable logic into server instances via plugin functions to add shared middleware and modify behavior. ([source](https://h3.dev/raw/guide/advanced/plugins.md))
- [Application Integration](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/application-integration.md) — Integrates nested server instances by merging routes and middleware under specific URL prefixes. ([source](https://h3.dev/raw/guide/basics/nested-apps.md))
- [Request Interception Middleware](https://awesome-repositories.com/f/software-engineering-architecture/request-interception-middleware.md) — Provides architectural patterns for routing traffic through security and logging layers before the final handler. ([source](https://h3.dev/raw/utils/more.md))
- [Request Validation](https://awesome-repositories.com/f/software-engineering-architecture/request-validation.md) — Validates query parameters and request bodies using schema libraries to return parsed data or errors. ([source](https://h3.dev/raw/utils/request.md))
- [Request Parameter Type-Hinting](https://awesome-repositories.com/f/software-engineering-architecture/type-hint-based-schema-definitions/request-parameter-type-hinting.md) — Assigns generic types to event handlers to provide automatic typing for request bodies and query parameters. ([source](https://h3.dev/raw/blog/v1.8.md))

### Web Development

- [Cross-Runtime Web Servers](https://awesome-repositories.com/f/web-development/cross-runtime-web-servers.md) — Provides a web server implementation that operates consistently across Node.js, edge runtimes, and serverless platforms.
- [HTTP Request Routing](https://awesome-repositories.com/f/web-development/http-request-routing.md) — Implements a system for mapping incoming HTTP methods and URL paths to specific handler functions. ([source](https://h3.dev/raw/guide/basics/routing.md))
- [HTTP Request Handlers](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/http-request-handlers.md) — Maps incoming HTTP traffic to specific typed handler functions for request processing.
- [HTTP Frameworks](https://awesome-repositories.com/f/web-development/http-frameworks.md) — Serves as a minimal, high-performance framework for building web servers across multiple JavaScript runtimes.
- [HTTP Handler Adapters](https://awesome-repositories.com/f/web-development/http-handler-adapters.md) — Wraps legacy request-response callbacks and modern web handlers to normalize them into a consistent internal event signature.
- [HTTP Request-Response Object Layers](https://awesome-repositories.com/f/web-development/http-request-response-object-layers.md) — Accesses incoming request details and modifies outgoing response headers through a unified event object. ([source](https://h3.dev/raw/guide/api/h3event.md))
- [Middleware Orchestration](https://awesome-repositories.com/f/web-development/middleware-orchestration.md) — Provides systems for managing request processing pipelines and reusable logic through a middleware orchestration layer.
- [Environment Runtime Adapters](https://awesome-repositories.com/f/web-development/request-adapters/environment-runtime-adapters.md) — Adapts applications to run across various environments, including edge runtimes and serverless platforms, via environment mapping. ([source](https://h3.dev/raw/blog/v1.8.md))
- [Catch-All Path Captures](https://awesome-repositories.com/f/web-development/request-routing/path-prefix-matching/catch-all-path-captures.md) — Supports catch-all patterns to resolve requests across multiple levels of sub-routes. ([source](https://h3.dev/raw/guide/basics/routing.md))
- [Route Parameter Accessors](https://awesome-repositories.com/f/web-development/routing-systems/routing-utilities/route-parameter-accessors.md) — Provides hooks to retrieve dynamic URL parameters and route metadata within handlers. ([source](https://h3.dev/raw/utils/request.md))
- [Route Parameter Captures](https://awesome-repositories.com/f/web-development/routing-systems/routing/parameter-handling-utilities/route-parameter-captures.md) — Provides utilities to extract named segments from URL paths as variables for route handlers. ([source](https://h3.dev/raw/guide/basics/routing.md))
- [Standards-Based Request Handlers](https://awesome-repositories.com/f/web-development/standards-based-request-handlers.md) — Adapts functions using the Request-Response signature into compatible event handlers for various runtimes. ([source](https://h3.dev/raw/guide/basics/handler.md))
- [Hierarchical Routing](https://awesome-repositories.com/f/web-development/url-generators/url-path-formatters/file-path-to-url-converters/path-based-routing/hierarchical-routing.md) — Organizes server logic through nested sub-applications mounted under specific path prefixes for modular route structures.
- [Web APIs](https://awesome-repositories.com/f/web-development/web-apis.md) — Provides a strongly typed interface for handling incoming data and sending responses using standard web API signatures.
- [Web Response Generation](https://awesome-repositories.com/f/web-development/web-response-generation.md) — Converts objects, strings, and binary data into standard web responses with appropriate content types. ([source](https://h3.dev/raw/guide/basics/response.md))
- [Web-Standard Request Abstractions](https://awesome-repositories.com/f/web-development/web-standard-request-abstractions.md) — Converts various input types into a standard web Request object based on available headers. ([source](https://h3.dev/raw/utils/request.md))
- [API Wrappers](https://awesome-repositories.com/f/web-development/web-standards/web-standard-apis/api-wrappers.md) — Normalizes various runtime request and response objects into standard Web API signatures.
- [Asynchronous Data Streams](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-response-handling/response-streaming/chunked-response-streams/asynchronous-data-streams.md) — Sends a sequence of data chunks to the client supporting mixed synchronous and asynchronous content. ([source](https://h3.dev/raw/utils/response.md))
- [Global Error Handlers](https://awesome-repositories.com/f/web-development/global-error-handlers.md) — Provides a system for managing application-wide error reporting and converting errors to graceful HTTP responses. ([source](https://h3.dev/raw/guide/basics/error.md))
- [Descriptive HTTP Error Responses](https://awesome-repositories.com/f/web-development/http-error-handling/descriptive-http-error-responses.md) — Throws structured errors to terminate requests with specific status codes and JSON payloads. ([source](https://h3.dev/raw/guide/basics/error.md))
- [Incremental Response Streaming](https://awesome-repositories.com/f/web-development/incremental-response-streaming.md) — Provides incremental response streaming to reduce perceived latency by sending data as it is produced. ([source](https://h3.dev/raw/examples.md))
- [Middleware Chains](https://awesome-repositories.com/f/web-development/middleware-chains.md) — Implements an architectural pattern for processing requests and responses through sequential middleware pipelines. ([source](https://h3.dev/raw/guide/basics/lifecycle.md))
- [Global Middleware Registration](https://awesome-repositories.com/f/web-development/middleware/global-middleware-registration.md) — Allows registration of middleware that executes for every incoming request to handle cross-cutting concerns. ([source](https://h3.dev/raw/guide/api/h3.md))
- [Real-Time Communication](https://awesome-repositories.com/f/web-development/real-time-communication.md) — Establishes bidirectional real-time communication channels between clients and the server using route-based WebSocket handlers. ([source](https://h3.dev/raw/guide/advanced/websocket.md))
- [Request Body Parsing](https://awesome-repositories.com/f/web-development/request-body-handling/request-body-alterations/request-body-parsing.md) — Reads the request body and parses it as JSON or URL search parameters. ([source](https://h3.dev/raw/utils/request.md))
- [Request Lifecycle Hooks](https://awesome-repositories.com/f/web-development/request-lifecycle-hooks.md) — Provides mechanisms to intercept and modify request processing at specific stages of the lifecycle. ([source](https://h3.dev/raw/guide/api/h3.md))
- [Request Metadata](https://awesome-repositories.com/f/web-development/request-metadata.md) — Retrieves the hostname, client IP, and protocol from the incoming request. ([source](https://h3.dev/raw/utils/request.md))
- [Request Pipelines](https://awesome-repositories.com/f/web-development/request-pipelines.md) — Implements systems for intercepting and processing network requests through sequential lifecycle hooks. ([source](https://h3.dev/raw/blog/v1.8.md))
- [Path Prefix Stripping](https://awesome-repositories.com/f/web-development/request-routing/path-prefix-matching/path-prefix-stripping.md) — Removes specific URL path prefixes to simplify route matching within nested sub-applications. ([source](https://h3.dev/raw/utils/more.md))
- [Response Formatting](https://awesome-repositories.com/f/web-development/response-formatting.md) — Converts returned values and headers into standard response objects before transmission. ([source](https://h3.dev/raw/guide/basics/lifecycle.md))
- [Session State Management](https://awesome-repositories.com/f/web-development/session-state-management.md) — Maintains user state and preferences across multiple requests using cookie-based session storage. ([source](https://h3.dev/raw/utils/security.md))
- [Universal Web Server Deployment](https://awesome-repositories.com/f/web-development/universal-web-server-deployment.md) — Runs a web server across multiple runtimes using a unified API for ports, TLS, and client context. ([source](https://h3.dev/raw/blog/v2-beta.md))
- [Static Asset Serving](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-server-capabilities/static-asset-serving.md) — Delivers static assets like HTML, CSS, and images using index files and caching mechanisms. ([source](https://h3.dev/raw/utils/response.md))
- [Web Security Hardening](https://awesome-repositories.com/f/web-development/web-security-hardening.md) — Implements security headers and protections to harden the server against common web vulnerabilities. ([source](https://h3.dev/raw/utils.md))
- [Server Mounts](https://awesome-repositories.com/f/web-development/web-server-frameworks/server-mounts.md) — Integrates sub-server instances into the main framework using URL prefixes for modular composition. ([source](https://h3.dev/raw/guide/api/h3.md))

### Networking & Communication

- [Middleware-Based Request Pipelines](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-processing/middleware-based-request-pipelines.md) — Processes HTTP requests through a sequential chain of pluggable middleware interceptors.
- [Middleware-Based Servers](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-routing-traffic-management/routing-engines/middleware-based-servers.md) — Implements a web server that processes requests through a sequence of modular middleware components.
- [HTTP Cookie Management](https://awesome-repositories.com/f/networking-communication/http-clients/http-cookie-management.md) — Parses request headers into key-value pairs and manages the setting and deletion of cookies. ([source](https://h3.dev/raw/utils/cookie.md))
- [Server-Sent Events](https://awesome-repositories.com/f/networking-communication/server-sent-events.md) — Implements Server-Sent Events to push real-time updates from the server to the client over a single connection. ([source](https://h3.dev/raw/guide/advanced/websocket.md))

### Data & Databases

- [Request Validation](https://awesome-repositories.com/f/data-databases/data-governance-modeling/data-management-governance/data-integrity-validation/data-validation/request-validation.md) — Parses, validates, and extracts data from incoming HTTP requests using specialized helpers. ([source](https://h3.dev/raw/utils.md))
- [HTTP Cache Headers](https://awesome-repositories.com/f/data-databases/performance-caching-systems/page-caching-controls/http-cache-headers.md) — Manages HTTP Cache-Control and Last-Modified headers to optimize browser and proxy caching. ([source](https://h3.dev/raw/utils/request.md))

### Programming Languages & Runtimes

- [Handler Adaptations](https://awesome-repositories.com/f/programming-languages-runtimes/node-js-runtime-compatibility/handler-adaptations.md) — Transforms legacy Node.js request-response callbacks into compatible event handlers for cross-runtime usage. ([source](https://h3.dev/raw/guide/basics/handler.md))

### Security & Cryptography

- [Basic Authentication](https://awesome-repositories.com/f/security-cryptography/basic-authentication.md) — Validates user credentials using the standard HTTP Basic Authentication scheme to protect routes. ([source](https://h3.dev/raw/utils/security.md))
- [Request Method Filters](https://awesome-repositories.com/f/security-cryptography/controller-filters/request-method-filters.md) — Enforces expected HTTP methods for endpoints and returns 405 errors for unsupported methods. ([source](https://h3.dev/raw/utils/request.md))
- [Cross-Origin Resource Sharing (CORS) Policies](https://awesome-repositories.com/f/security-cryptography/cross-origin-resource-sharing-cors-policies.md) — Manages Cross-Origin Resource Sharing by validating origins and handling preflight requests. ([source](https://h3.dev/raw/utils/security.md))

### User Interface & Experience

- [Route Property Attachments](https://awesome-repositories.com/f/user-interface-experience/attached-properties/route-metadata/route-property-attachments.md) — Allows storing custom properties on route definitions that middleware can access to control behavior. ([source](https://h3.dev/raw/guide/basics/routing.md))
