@hono/node-server

The official Node.js adapter that runs your Hono application on a native Node HTTP server using web-standard APIs.

Library
npm
v2.1.5
682 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
81 /100 Excellent
Development Activity 80
Maintenance 88
Community 60
Maturity 56
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 88
Code Quality 86
Innovation 90
Learning Curve 88

@hono/node-server is the official adapter that lets you run a Hono application on Node.js without changing your handler code. Hono was originally built for edge runtimes like Cloudflare Workers, Deno, and Bun, and this package bridges that web-standard fetch model onto Node’s built-in http and http2 servers.

It ships lightweight Request and Response implementations that avoid unnecessary copying, giving benchmark throughput several times higher than a comparable Express server. Beyond the core serve() entry point, it bundles Node-specific helpers for static file serving, WebSocket upgrades, connection info, and direct access to the underlying Node request/response objects.

What You Get

  • A one-line serve(app) entry point that boots a native Node HTTP (or HTTP/2, or HTTPS) server for any Hono app.
  • Lightweight Request/Response shims that override the global objects for markedly faster throughput than a plain Express server.
  • A Node-native serve-static middleware with precompression, path rewriting, and found/not-found hooks.
  • First-class WebSocket upgrade support via upgradeWebSocket backed by a ws WebSocketServer.
  • Helpers for connection info (getConnInfo) and typed access to the raw Node IncomingMessage / ServerResponse through c.env.

Common Use Cases

  • Deploying a Hono API to a traditional Node.js host, container, or VM instead of an edge runtime.
  • Serving static assets and a Hono API from the same Node process.
  • Adding realtime WebSocket endpoints to a Hono application running on Node.
  • Migrating an existing Node.js HTTP service to Hono incrementally by responding directly from the Node API where needed.

Under The Hood

Architecture — The adapter is organized as a thin bridge over Node’s HTTP stack. server.ts exposes createAdaptorServer/serve, which build a native node:http (or a user-supplied HTTP/2 or HTTPS) server whose request handler comes from getRequestListener in listener.ts. That listener is the core: it wraps each Node IncomingMessage in a lightweight web Request (request.ts), invokes the app’s fetch callback, and streams the returned Response back through response.ts, using symbol-tagged internal state, explicit incoming-body draining, and configurable auto-cleanup to keep half-read connections from stalling the server. Peripheral concerns are isolated in their own modules — websocket.ts (upgrade handling atop a ws server), serve-static.ts, conninfo.ts, and url.ts.

Tech Stack — The package is written almost entirely in TypeScript (~99%) with zero runtime dependencies; hono is a ^4 peer dependency and ws is optional for WebSockets. It targets Node >=20 and builds only on the standard library (node:http, node:http2, node:stream, node:net, node:tls). Tooling is modern: tsdown for the dual ESM/CJS build with subpath exports, Vitest plus supertest for tests, publint for package linting, and ESLint/Prettier for style.

Code Quality — Fifteen Vitest test files exercise the listener, request/response shims, WebSockets, conninfo, serve-static, and edge cases like client disconnects, giving strong coverage of the tricky streaming paths. The code is carefully typed, leans on Symbols for private state, mirrors native Request/Response semantics closely (including guarding against re-reading consumed bodies), and handles resource cleanup and error translation (RequestError, toRequestError) explicitly rather than swallowing failures.

API Design — The public surface is deliberately minimal: serve(app) is a genuine one-liner, and everything else is opt-in through a well-typed Options object (port, hostname, createServer, serverOptions, websocket, overrideGlobalObjects, autoCleanupIncoming). Extra capabilities live behind clean subpath imports (@hono/node-server/serve-static, /conninfo, /utils/response), and the README is thorough with runnable examples for every option, HTTPS, HTTP/2, UNIX sockets, and the raw-Node escape hatch — so getting started requires almost no boilerplate.

Used by 37 apps in this directory

TypeScript
91%
Apache 2.0

HyperFrames

AI Design Tools · AI Development

70,938

Turn plain HTML and CSS into deterministic, pixel-perfect MP4 videos — authored by humans or AI agents, rendered by headless Chrome and FFmpeg.

View details
84
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 91%
Updated 5 days ago
TypeScript
92%
MIT

Kaneo

Product Management · Productivity · Project Management

9,574

Lightweight self-hosted project management that gives you kanban boards, GitHub sync, and full team collaboration without the enterprise bloat.

View details
87
Repo Health
81
Technical
70
Dependency
Built with
TypeScript 92%
Updated 5 days ago
TypeScript
98%
AGPL 3.0

Karakeep

Bookmarks Archiving

29,926

Self-hosted bookmark manager that captures links, notes, images, and PDFs with AI tagging, full-text search, and automatic archiving.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
TypeScript
98%
MIT

Kimi Code CLI

AI Agents · AI Code Assistants · Developer Tools

7,983

A single-binary, terminal-native coding agent that reads, edits, and runs code end to end, built by Moonshot AI for Kimi models but pluggable with Anthropic, OpenAI, and Google providers too.

View details
83
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
78%
LGPL 3.0

Latitude

AI Agents · Monitoring

4,733

Open-source AI agent monitoring that catches what will break next before your users do.

View details
87
Repo Health
88
Technical
67
Dependency
Built with
TypeScript 78%
Python 11%
Rust 11%
Updated 6 days ago
TypeScript
96%
MIT

likec4

Developer Tools · Devops

5,954

Define your software architecture as code and get always up-to-date, interactive C4 diagrams generated automatically from a DSL.

View details
89
Repo Health
83
Technical
78
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
95%
Other

LLM Gateway

AI Development · Devops

1,704

One API endpoint for 25+ LLM providers — route, track costs, enforce compliance, and switch models without changing your code.

View details
86
Repo Health
80
Technical
67
Dependency
Built with
TypeScript 95%
Updated 6 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

29,041

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
96%
AGPL 3.0

Midday

Invoicing Finance · Productivity

15,091

All-in-one AI-powered business operations platform for freelancers and solo entrepreneurs to manage invoicing, time tracking, banking, and financial intelligence.

View details
51
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 96%
Updated 4 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers