Guide
Hono vs Express vs Fastify vs Elysia 2026



Choosing a Hono alternative? Compare Express, Fastify and Elysia for Node.js and Bun deployments, schema validation, typed clients and the work of migration.
Contents
Contents
Verdict: For a Hono replacement, shortlist Fastify on Node.js when JSON Schema and scoped plugins solve your problem. Evaluate Elysia on Bun when route schemas and Eden fit your client workflow; Node.js requires its adapter. Choose Express when required middleware makes its request model useful. Keep Hono if Fetch handlers and deployment portability still meet your needs. The runtime integrations are a reason to test before switching.
Quick decision matrix: choosing a Hono alternative
Start with the constraint Hono fails to meet. This is our replacement-selection matrix, based on the frameworks' documentation. Each recommendation is an editorial judgment about fit; the linked sources establish the interfaces behind it.
| Your constraint | First option to evaluate | Condition to verify before replacing Hono |
|---|---|---|
| Node.js API needs schema-driven validation and plugin scope | Fastify | Request and response schemas fit the contract; required plugins work in their registered scope. |
| Bun service wants schemas and handler inference together | Elysia | Route schemas and Eden cover the client contract; required dependencies work on Bun. |
| Node.js service wants Elysia's schema model | Elysia with its Node adapter | Test the documented Node.js integration with the actual plugins and host. |
| Required integration assumes Express request/response objects | Express | The middleware supports Express 5 and survives the migration changes; it will still require a Hono route rewrite. |
| One application must target Workers and server runtimes | Keep Hono as the baseline | Check each runtime entry point and platform dependency before giving up the existing Fetch interface. |
| The problem is provisioning databases or coordinating deployments | Assess the backend platform separately | Use the Encore infrastructure comparison; changing an HTTP router alone does not settle infrastructure ownership. |
For the exact Bun-oriented pair, use Hono vs Elysia. This guide covers the broader replacement shortlist across Node.js and Bun. The Fastify vs Hono package comparison supplies a separate package-level view.
Fastify: a Hono replacement for schema-driven Node.js APIs
Fastify is a useful starting point for a new Node.js service when JSON Schema suits the API contract. Its default request validation uses Ajv, while response schemas drive fast-json-stringify serialization. These are different jobs: a response schema is not a substitute for request validation or authorization. The schema documentation describes the defaults and compiler overrides.
When moving a Hono validator to Fastify, define both the accepted input and the public response shape. Check missing fields, invalid types and fields that must never reach the client. Validation does not look up permissions or write a database row.
Plugin registration determines where hooks, decorators and shared schemas apply. Ordinary registered plugins create encapsulated contexts. fastify-plugin can deliberately expose a plugin's additions to its parent; it is not the mechanism for making every plugin private. Review authentication scope with both a protected route and a neighboring public route. The encapsulation reference explains that inheritance model.
Fastify's TypeScript support also includes type providers, which infer handler types from supported schemas. Explicit generics are an option, not the only approach. That inference concerns server code; decide separately how external clients receive a contract, such as an OpenAPI-generated client or a shared schema package.
Fastify 5 requires Node.js 20 or newer and full JSON Schemas for the relevant request and response declarations. Review plugin compatibility during an upgrade rather than installing an arbitrary plugin major. The v5 migration guide is the starting checklist.
Keep Hono when portability is the requirement
Hono is a good fit when a service may run on more than one deployment platform. Its handlers use web Request/Response concepts and a Hono Context. The getting-started documentation lists runtime-specific integrations, including Cloudflare Workers, Bun, Deno and Node.js.
Portability has limits. A shared handler does not make a Node-only database driver, filesystem call or platform secret binding portable. Keep those dependencies explicit and exercise the actual target. An application that passes Node.js tests can still fail in Workers because of a dependency or binding that its unit tests never load.
Hono on Node.js uses @hono/node-server to serve app.fetch. The Node.js adapter guide documents this serving interface. A Workers entry point instead exports the application, while Bun can serve its fetch handler. Select the entry point for the deployment rather than assuming the Node adapter belongs in every bundle.
Hono provides a thin validation helper; Zod or TypeBox validation is not automatically included merely by installing Hono. Choose and configure the appropriate integration. Send the correct content type in tests, since JSON validation depends on parsing JSON input. See the validation guide.
Hono RPC lets hc<AppType> infer route inputs and JSON outputs from an exported application type. Preserve the inferred route type through chained route declarations and use strict TypeScript settings on both sides. This can help a TypeScript client stay aligned with the server, but it does not validate an arbitrary remote response at runtime or version an independently deployed consumer for you.
Elysia: evaluate schema inference on Bun or Node.js
Elysia fits a team that wants request schemas, response schemas and handler inference together. Bun is a natural deployment choice, but Elysia also documents a Node.js adapter; a Bun-only description would exclude a supported integration. Check the actual adapter and plugin combination before committing to a host.
Elysia's validation documentation describes its TypeBox-based t builder and support for Standard Schema libraries. This gives a Hono maintainer a concrete comparison: keep separate validation middleware, or put a supported schema on the Elysia route. Test how both choices report invalid input to existing clients.
On Node.js, construct the instance with new Elysia({ adapter: node() }), importing node from @elysia/node, before calling .listen(). The official Node integration supplies the setup. On Bun, the default adapter can listen directly. Test streaming, shutdown and any runtime-specific dependencies in that deployment configuration.
Eden provides a client that infers types from the exported Elysia application type without code generation. Evaluate the coupling: a shared type is convenient within a TypeScript codebase, while public APIs and independently released clients also need compatibility and versioning rules. Inferred types cannot decide whether an API change is safe for a consumer still running yesterday's build.
Express: choose it for required middleware
Express belongs on a Hono replacement shortlist when a required integration assumes its request/response interface. For an existing Express service, retaining working middleware is also a reasonable choice. Retaining it avoids a rewrite of request handling, authentication, sessions, uploads and error reporting. That is a migration-cost judgment, not a claim about market share or future maintenance.
Express 5 requires Node.js 18 or newer. It forwards rejected promises from async handlers to error middleware. An Express 4 upgrade still needs a compatibility review: route-path syntax, removed APIs and parsing behavior changed. The official migration guide documents those changes; changing only the package version is not a migration plan.
Test both a successful response and a rejected async handler before changing error handling. In a real service, log the exception internally without returning its stack or private fields to the caller.
Treat validation and response shaping as explicit application work. Do not assume that a TypeScript request annotation rejects malformed JSON at runtime. Keep request parsing, authentication, validation and authorization in an order that the team can explain and test. If those controls already work, first measure the service before proposing a framework migration.
Migration notes: replace one Hono route first
Before rewriting the application, identify the reason to leave Hono: a missing integration, a schema contract that is difficult to maintain, or a deployment constraint. Capture a failing case or a measurable maintenance cost. If there is no concrete failure, keep the working implementation while evaluating a candidate.
Inventory Hono middleware, context variables, environment bindings, validators and RPC consumers. Moving to Fastify means translating these into request/reply handling and plugin contexts. Moving to Express means explicit parsing and validation around its middleware chain. Moving to Elysia means expressing the same controls through route schemas, plugins and hooks. None is a package-name substitution.
Use this acceptance worksheet on the route with the hardest dependency. Fill the expected result from the existing API contract, then exercise it on Hono and the candidate with the same fixtures.
| Trial | Required observation | Reason to stop the move |
|---|---|---|
| Valid request and invalid body | Status, headers and error shape meet the contract | Clients would need an unplanned behavior change |
| Missing or expired credentials | Authorization runs before protected work | A protected response or side effect is reachable |
| Client compile | The actual consumer handles all declared responses | Hono RPC types disappear without a replacement contract |
| Upload or streamed response | The deployed adapter handles the real payload | Local route tests pass but the target host fails |
| Dependency failure and shutdown | Errors and in-flight work follow the service policy | The service cannot recover or shut down as required |
If you also maintain Express middleware
Inventory middleware before translating route syntax. Record each middleware's purpose, request mutations, response writes, error behavior and dependence on Node.js objects. Authentication and session middleware deserve a complete request-flow test, including missing credentials, expired sessions and rejected access.
For Fastify, map each concern to a compatible plugin or lifecycle hook and verify its registration scope. For Hono, rewrite against Context and Fetch interfaces. Passing c.req.raw and c.res into arbitrary Express middleware does not reproduce Node's IncomingMessage and ServerResponse contract. For Elysia, map behavior to its plugin and hook model and check where those hooks apply.
Migrate one representative route with the original tests still available. Compare status codes, headers, cookies, validation errors and the response body. Include an upload or streamed response if the service uses one; a health endpoint alone cannot expose those migration costs. Keep a rollback path that sends traffic back to the previous handler until the replacement has passed these checks.
For narrower decisions, use Express vs Fastify, Hono vs Elysia, and Express vs Hono. Those comparisons can help once runtime constraints have reduced the shortlist.
Testing and operating constraints
Fastify's testing guide uses app.inject() to exercise routes without opening a listening port. Hono's testing guide uses Request/Response and app.request(). Elysia's unit-test guide uses app.handle() with an absolute Request URL. Keep application construction separate from the listening process so tests can use these interfaces.
These helpers are useful for route behavior. They do not prove the host's connection handling, TLS termination, proxy headers, shutdown behavior or production bindings. Add a small deployed-environment check for those concerns before a migration goes live. Verify that logs carry enough context to connect a failing request to its downstream call without logging credentials or private payloads.
For a service evaluation, agree on operating limits before running load tests: body size, request timeout, outbound connection limits and the expected response to a dependency failure. Implement the same behavior in each candidate. A framework that returns quickly because it skips validation or authentication is not doing the same job.
Methodology
This guide compares documented interfaces and supplies an original replacement matrix and acceptance worksheet. It contains no throughput ranking or executed framework comparison. Express 5 and Fastify 5 migration rules are linked to their official guides; Hono and Elysia behavior is linked to their current documentation. Pin exact package and runtime versions in your trial rather than treating these docs as a compatibility guarantee for every release.
For your own comparison, use a representative endpoint with the same database calls, payload, validation, authentication and logging. Record the runtime and package versions with the fixtures. If performance is the reason to move, also record hardware, concurrency, warm-up, duration, error rate, latency percentiles and memory. Keep the harness so another maintainer can repeat it, and decide in advance what improvement would justify migration.
Make the replacement decision
Keep Hono when its deployment targets and existing behavior meet the contract. Choose Express when a required middleware integration justifies translating the request model. Prefer Fastify when the Node.js deployment is fixed and schema-driven routes and plugin scope fit the service. Prefer Elysia when schema inference and Eden fit the team's API development, after checking the chosen runtime adapter.
If two options remain, implement the route with the hardest integration first. Keep the choice and its assumptions in the service repository: deployment target, required plugins, contract ownership, failure tests and the reason to revisit it. That record is more useful to the next maintainer than an unexplained performance ranking.
Related guides
- Hono vs Elysia: the pairwise choice
- Express vs Fastify: the Node.js migration decision
- Encore.ts vs Hono vs Elysia: backend infrastructure
- Fastify vs Hono package comparison
- Hono package health
Source notes
Framework documentation supports each framework's own interfaces. The selection recommendations and evaluation worksheet are our synthesis. Source access dates are recorded in the guide packet.
- Express 5 migration: runtime minimum, rejected promises and breaking changes.
- Fastify validation and serialization: request validation and response serialization.
- Fastify encapsulation: plugin contexts and
fastify-pluginbehavior.
- Fastify type providers: inference from schemas.
- Fastify v5 migration: runtime and full-schema requirements.
- Fastify testing: injection and separating app construction from listening.
- Hono getting started: supported deployment integrations.
- Hono on Node.js: serving a Fetch application with the adapter.
- Hono validation: validator and schema-library integrations.
- Hono RPC: exported route types and typed clients.
- Hono testing: request-based route tests.
- Elysia validation: schema validation and type inference.
- Elysia on Node.js: adapter setup.
- Elysia Eden: inferred client types.
- Elysia testing: Request/Response testing.