TopGit tracks honojs/node-server on GitHub as part of the Backend family. The project has 672 stars. Node.js Server for Hono
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
This adapter @hono/node-server allows you to run your Hono application on Node.js.
Initially, Hono wasn't designed for Node.js, but with this adapter, you can now use Hono on Node.js. It utilizes web standard APIs implemented in Node.js.
Just import @hono/node-server at the top and write the code as usual.
The same code that runs on Cloudflare Workers, Deno, and Bun will work.
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hono meets Node.js'))
serve(app, (info) => {
console.log(`Listening on http://localhost:${info.port}`) // Listening on http://localhost:3000
})
WebSocket
You can upgrade WebSocket connections with upgradeWebSocket from @hono/node-server.
To enable this, install ws (and @types/ws) in your project, then create and provide a WebSocketServer as shown in the example below.
The default value is true. The Node.js Adapter rewrites the global Request/Response and uses a lightweight Request/Response to improve performance. If you don't want to do that, set false.
The default value is true. The Node.js Adapter automatically cleans up (explicitly call destroy() method) if application is not finished to consume the incoming request. If you don't want to do that, set false.
If the application accepts connections from arbitrary clients, this cleanup must be done otherwise incomplete requests from clients may cause the application to stop responding. If your application only accepts connections from trusted clients, such as in a reverse proxy environment and there is no process that returns a response without reading the body of the POST request all the way through, you can improve performance by setting it to false.
If using a relative path, root will be relative to the current working directory from which the app was started.
This can cause confusion when running your application locally.
Imagine your project structure is:
my-hono-project/
src/
index.ts
static/
index.html
Typically, you would run your app from the project's root directory (my-hono-project),
so you would need the following code to serve the static folder:
The onNotFound is useful for debugging. You can write a handle for when a file is not found.
app.use(
'/static/*',
serveStatic({
root: './non-existent-dir',
onNotFound: (path, c) => {
console.log(`${path} is not found, request to ${c.req.path}`)
},
})
)
precompressed
The precompressed option checks if files with extensions like .br or .gz are available and serves them based on the Accept-Encoding header. It prioritizes Brotli, then Zstd, and Gzip. If none are available, it serves the original file.
You can use the ConnInfo Helper by importing getConnInfo from @hono/node-server/conninfo.
import { getConnInfo } from '@hono/node-server/conninfo'
app.get('/', (c) => {
const info = getConnInfo(c) // info is `ConnInfo`
return c.text(`Your remote address is ${info.remote.address}`)
})
Accessing Node.js API
You can access the Node.js API from c.env in Node.js. For example, if you want to specify a type, you can write the following.
import { serve } from '@hono/node-server'
import type { HttpBindings } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono<{ Bindings: HttpBindings }>()
app.get('/', (c) => {
return c.json({
remoteAddress: c.env.incoming.socket.remoteAddress,
})
})
serve(app)
The APIs that you can get from c.env are as follows.
type HttpBindings = {
incoming: IncomingMessage
outgoing: ServerResponse
}
type Http2Bindings = {
incoming: Http2ServerRequest
outgoing: Http2ServerResponse
}
Early Hints Middleware
You can send HTTP 103 Early Hints to instruct browsers to preload or preconnect resources before the final response is prepared. The middleware is supported under Node.js bindings (HTTP/1.1 and HTTP/2).
Usage
Import earlyHints from @hono/node-server/early-hints:
[!NOTE]
Early Hints are sent only for requests that look like document navigations. If Sec-Fetch-Mode or Sec-Fetch-Dest is present with a value other than navigate or document, for example a fetch() or XHR call from a browser, a subresource request, or an iframe navigation, the middleware skips the hints and continues to the handler. Requests without these headers, such as curl or fetch() from a JavaScript runtime, are treated as navigations and do receive Early Hints.
Direct response from Node.js API
You can directly respond to the client from the Node.js API.
In that case, the response from Hono should be ignored, so return RESPONSE_ALREADY_SENT.
[!NOTE]
This feature can be used when migrating existing Node.js applications to Hono, but we recommend using Hono's API for new applications.
import { serve } from '@hono/node-server'
import type { HttpBindings } from '@hono/node-server'
import { RESPONSE_ALREADY_SENT } from '@hono/node-server/utils/response'
import { Hono } from 'hono'
const app = new Hono<{ Bindings: HttpBindings }>()
app.get('/', (c) => {
const { outgoing } = c.env
outgoing.writeHead(200, { 'Content-Type': 'text/plain' })
outgoing.end('Hello World\n')
return RESPONSE_ALREADY_SENT
})
serve(app)
Listen to a UNIX domain socket
You can configure the HTTP server to listen to a UNIX domain socket instead of a TCP port.
import { createAdaptorServer } from '@hono/node-server'
// ...
const socketPath = '/tmp/example.sock'
const server = createAdaptorServer(app)
server.listen(socketPath, () => {
console.log(`Listening on ${socketPath}`)
})
How does honojs/node-server compare to other Backend projects?
honojs/node-server is tracked by TopGit in the Backend category, with 672 GitHub stars and written in TypeScript. Browse the Backend topic page on TopGit to compare it against similar projects by stars and activity.
Is honojs/node-server open source?
Yes — honojs/node-server ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/honojs/node-server.
What else is in the Backend space?
honojs/node-server is tracked by TopGit under the Backend category, alongside 4 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is honojs/node-server?
honojs/node-server (honojs/node-server) is a TypeScript project on GitHub. From the project's own README: Node.js Server for Hono
Where do I read more about honojs/node-server?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/honojs/node-server is the definitive source.
Why is honojs/node-server categorized under Backend?
TopGit places honojs/node-server in the Backend category based on its GitHub topics and description (tagged: "hono", "http-server", "nodejs"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Is node-server worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of node-server.