Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ESLint plugin.
- [`eslint-plugin-react`](./eslint-plugin-react.md)
- [`eslint-plugin-vitest`](./eslint-plugin-vitest.md)
- [`execa`](./execa.md)
- [`express`](./express.md)
- [`ezspawn`](./ez-spawn.md)
- [`faker`](./faker.md)
- [`fast-glob`](./fast-glob.md)
Expand Down
85 changes: 85 additions & 0 deletions docs/modules/express.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
description: Modern alternatives to the express package
---

# Replacements for `express`

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`

[`h3`](https://github.com/h3js/h3) is a minimal H(TTP) framework built for high performance and portability.
Comment thread
gameroman marked this conversation as resolved.

Example:

<!-- prettier-ignore -->
```ts
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`

[`tinyhttp`](https://github.com/tinyhttp/tinyhttp) is designed to be a drop-in replacement remaining compatible with many Express middlewares.

Example:

```ts
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`

[`hono`](https://github.com/honojs/hono) is a small, simple, and fast web framework for the Edges.

Example:

```ts
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 ++]
```

## `elysia`

If you are using Bun, [`elysia`](https://github.com/elysiajs/elysia) is often the best choice as it is specifically optimized for the Bun runtime.

Example:

```ts
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)
```
30 changes: 30 additions & 0 deletions manifests/preferred.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@
"replacements": ["tinyexec", "nanoexec", "Bun.Shell"],
"url": {"type": "e18e", "id": "execa"}
},
"express": {
"type": "module",
"moduleName": "express",
"replacements": ["h3", "tinyhttp", "hono", "elysia"],
"url": {"type": "e18e", "id": "express"}
},
"ez-spawn": {
"type": "module",
"moduleName": "ez-spawn",
Expand Down Expand Up @@ -2795,6 +2801,12 @@
"url": {"type": "e18e", "id": "dot-prop"},
"replacementModule": "dlv"
},
"elysia": {
"id": "elysia",
"type": "documented",
"url": {"type": "e18e", "id": "express"},
"replacementModule": "elysia"
},
"emoji-regex-xs": {
"id": "emoji-regex-xs",
"type": "documented",
Expand Down Expand Up @@ -2942,6 +2954,18 @@
"url": {"type": "e18e", "id": "node-telegram-bot-api"},
"replacementModule": "grammy"
},
"h3": {
"id": "h3",
"type": "documented",
"url": {"type": "e18e", "id": "express"},
"replacementModule": "h3"
},
"hono": {
"id": "hono",
"type": "documented",
"url": {"type": "e18e", "id": "express"},
"replacementModule": "hono"
},
"isBuiltin": {
"id": "isBuiltin",
"type": "native",
Expand Down Expand Up @@ -3171,6 +3195,12 @@
"url": {"type": "e18e", "id": "fast-glob"},
"replacementModule": "tinyglobby"
},
"tinyhttp": {
"id": "tinyhttp",
"type": "documented",
"url": {"type": "e18e", "id": "express"},
"replacementModule": "@tinyhttp/app"
Comment thread
gameroman marked this conversation as resolved.
},
"unicode-segmenter": {
"id": "unicode-segmenter",
"type": "documented",
Expand Down
Loading