
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
@honojs/node-server
Advanced tools
This project is still experimental.
This is HTTP Server for Hono on Node.js. Hono is ultrafast web framework for Cloudflare Workers, Deno, and Bun. It's not for Node.js. BUT, there may be a case that you really want to run on Node.js. This library is an adapter server that connects Hono and Node.js.
Hono is ultra fast, but not so fast on Node.js, because there is an overhead to adapt Hono's API to Node.js.
By the way, it is 2.x times faster than Express.
You can install from npm registry with npm
command:
npm install @honojs/node-server
Or use yarn
:
yarn add @honojs/node-server
Just import @honojs/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 '@honojs/node-server' // Write above `Hono`
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hono meets Node.js'))
serve(app)
For example, run it using ts-node
. Then an HTTP server will be launched. The default port is 3000
.
ts-node ./index.ts
Open http://localhost:3000
with your browser.
serve({
fetch: app.fetch,
port: 8787, // Port number, default is 3000
})
Most built-in middleware also works with Node.js. Read the documentation and use the Middleware of your liking.
import { serve } from '@honojs/node-server'
import { Hono } from 'hono'
import { prettyJSON } from 'hono/pretty-json'
const app = new Hono()
app.get('*', prettyJSON())
app.get('/', (c) => c.json({ 'Hono meets': 'Node.js' }))
serve(app)
Use Serve Static Middleware that has been created for Node.js.
import { serve, serveStatic } from '@honojs/node-server'
//...
app.use('/static/*', serveStatic({ root: './' }))
Yusuke Wada https://github.com/yusukebe
MIT
FAQs
HTTP Server for Hono on Node.js
The npm package @honojs/node-server receives a total of 1 weekly downloads. As such, @honojs/node-server popularity was classified as not popular.
We found that @honojs/node-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.