| description | Modern alternatives to the express package |
|---|
Express has been the industry standard for years, but the ecosystem has shifted toward ESM-first, type-safe, and runtime-agnostic frameworks that offer significantly better performance and developer experience.
h3 is a minimal H(TTP) framework built for high performance and portability.
Example:
import express from 'express' // [!code --]
import { H3, defineHandler, toNodeHandler } from 'h3' // [!code ++]
import { createServer } from 'node:http' // [!code ++]
const app = express() // [!code --]
const app = new H3() // [!code ++]
app.get('/', (req, res) => res.send('Hello world')) // [!code --]
app.get('/', defineHandler(() => 'Hello world')) // [!code ++]
app.listen(3000) // [!code --]
createServer(toNodeHandler(app)).listen(3000) // [!code ++]tinyhttp is designed to be a drop-in replacement remaining compatible with many Express middlewares.
Example:
import express from 'express' // [!code --]
import { App } from '@tinyhttp/app' // [!code ++]
const app = express() // [!code --]
const app = new App() // [!code ++]
app.get('/', (req, res) => res.send('Hello world'))
app.listen(3000)hono is a small, simple, and fast web framework for the Edges.
Example:
import express from 'express' // [!code --]
import { Hono } from 'hono' // [!code ++]
const app = express() // [!code --]
const app = new Hono() // [!code ++]
app.get('/', (req, res) => res.send('Hello world')) // [!code --]
app.get('/', (context) => context.text('Hello world')) // [!code ++]
export default app // [!code ++]If you are using Bun, elysia is often the best choice as it is specifically optimized for the Bun runtime.
Example:
import express from 'express' // [!code --]
import { Elysia } from 'elysia' // [!code ++]
const app = express() // [!code --]
const app = new Elysia() // [!code ++]
app.get('/', (req, res) => res.send('Hello world')) // [!code --]
app.get('/', () => 'Hello world') // [!code ++]
app.listen(3000)