# Express — card for AI agents

Fast, unopinionated minimalist web framework for Node.js.

Category: HTTP servers and APIs · npm package `express` · latest version 5.3.0 (checked 2026-11-01)
Install: `npm install express`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Express
- Confirm the runtime is Node.js 18 or higher. In a new project, run `npm init` to create `package.json` first, then `npm install express`.
- Find out whether the project is on v4 or v5 and use the matching docs. When upgrading, read the migration guide to v5 that the README points to.
- For machine-readable docs, use the files listed in `https://expressjs.com/llms.txt`. Guides exist for v5 and v4 (`llms/guides-5x.txt`, `llms/guides-4x.txt`). API references exist for v5, v4 and v3 (for example `llms/api-5x.txt`).
- Do not expect features in core that the docs leave to middleware. The core is minimal and meant to be augmented with Express middleware modules.
- Express does not force any specific ORM or template engine. Use what the project already uses.
- Keep middleware current. The site has announced security releases for compression, cookies, hbs, morgan, multer, multiparty and proxy-addr, and recommends upgrading as soon as possible.

## Docs written for agents
- [llms.txt (index of the docs)](https://expressjs.com/llms.txt)

## What it is
- Express is a web framework for Node.js. The GitHub repository describes it as a "Fast, unopinionated, minimalist web framework for node". The repository was created on 2009-06-26 and is MIT licensed. The latest GitHub release is v5.3.0. The website has a version menu for v5.x and v4.x, and lists v3.x as deprecated.
- You create an app with `express()`, attach handlers to routes such as `app.get('/', ...)`, and call `app.listen`. The README's feature list covers routing, HTTP helpers for redirection and caching, content negotiation, a view system for 14+ template engines, and an executable that generates a starter app.
- The maintainers name single page applications, websites, hybrids and public HTTP APIs as its targets. For APIs, the website points to "a myriad of HTTP utility methods and middleware". The site describes the core features as minimal and "meant to be augmented" through Express middleware modules.

## Caveats
- Node.js 18 or newer: The README requires Node.js 18 or higher. For a brand new project, it says to create a `package.json` with `npm init` before installing.
- README mixes v5 and v4 pointers: The README's PROTIP sends readers to the migration guide to v5. Its quick start installs `express-generator@4` and says "The executable's major version will match Express's".
- Security releases for middleware: The website announced security releases for compression, cookies, hbs, morgan, multer, multiparty and proxy-addr. It recommends "all users upgrade as soon as possible." Our inference, not the site's: an app that uses these modules has to update them separately from Express itself.
- res.send() headers changed in v5.3.0: In v5.3.0, `res.send()` adds `Content-Length` only when no `Transfer-Encoding` header is present. Our inference, not the release notes': code that expected `Content-Length` in every case may see different responses after the upgrade.

## Numbers (AgentGid data)
- Gid Score: 89.2 (#12 of all tools, 2 of 102 in its category)
- Used in 425 public projects set up for AI coding agents (6.8%)
- Downloads last week: 209,772,988 (as of 2026-11-24), +41.4% over 4 weeks
- GitHub stars: 69,683 (as of 2026-11-24)
- Last push: 2026-11-19

## Often used with
dotenv 61.6%, cors 45.2%, tsx 45.6%, Model Context Protocol SDK (JavaScript) 32.0%, TypeScript 75.1%, Zod 50.6%

## Checked alternatives (same job)
- Hono: https://agentgid.com/tools/hono/agent.md
- NestJS: https://agentgid.com/tools/nestjs/agent.md
- Nitro: https://agentgid.com/tools/nitro/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/express/
- Homepage: https://expressjs.com/
- Repository: https://github.com/expressjs/express
- Source: https://github.com/expressjs/express#readme
- Source: https://github.com/expressjs/express
- Source: https://github.com/expressjs/express/releases
- Source: https://expressjs.com
- Source: https://expressjs.com/llms.txt


## Express: the classic web server for Node.js apps

Express is a free, small framework for building the server side of a website or app in JavaScript with Node.js. You say which web addresses your server answers and what it sends back, such as a page, a file or data for your app. Most extras, like logins, uploads or security headers, come as add-on packages you plug in.

### Where to use it
- A small backend for your app: Your web or mobile app needs a server that answers a few addresses, like /products or /orders, with data. Express sets that up in a few lines.
- Serve a built website and its files: Put your finished site, images and styles in a public folder and Express hands them to visitors as they ask for them.
- Load records from a database: A page asks for one customer or order by its number; your route waits for the database and returns it. If the lookup fails, Express sends the error to your error handler.
- Accept form and JSON data: Your sign-up form or app sends data to the server; Express reads it once you switch on its JSON or form reader.
- Pages built from templates: Your server fills page templates with data, like a product page per item, and sends finished pages to the browser.
- Receive alerts from other services: A payment or code hosting service calls your server when something happens; one Express route receives the alert and starts your follow-up work. (idea, not from the official pages)

### How to start
- Install Express into your project (Node.js 18 or newer).

```
npm install express
```

- For TypeScript, add the community type packages as development tools.

```
npm install --save-dev typescript @types/express @types/node
```

- Write a first route and start the server, then open http://localhost:3000.

```
import express from 'express'

const app = express()

app.get('/', (req, res) => {
  res.send('Hello World')
})

app.listen(3000, () => {
  console.log('Server is running on http://localhost:3000')
})
```


### License
Free to use, also in paid and closed-source products, under the MIT license. Keep the copyright and license notice when you pass its files on.

### Good to know
- Version 5 needs Node.js 18 or newer. Versions 4 and 5 are both still supported; 2.x and 3.x get no fixes.
- Version 5 changed several things, so code and tutorials written for version 4 can break after an upgrade.
- Form and JSON data is not read until you add a reader such as express.json(); without it the data is simply missing.
- Security headers are not set for you; the Express team suggests the Helmet add-on and hiding the default X-Powered-By header.
- For encrypted connections the docs recommend putting a separate server such as Nginx in front.

Checked 2026-11-11 against: https://github.com/expressjs/express/blob/master/Readme.md, https://github.com/expressjs/express/blob/master/History.md, https://github.com/expressjs/express/blob/master/LICENSE, https://registry.npmjs.org/express, https://registry.npmjs.org/express/latest, https://expressjs.com/en/starter/installing.html, https://expressjs.com/en/starter/hello-world.html, https://expressjs.com/en/starter/static-files.html, https://expressjs.com/en/guide/routing.html, https://expressjs.com/en/guide/using-middleware.html, https://expressjs.com/en/guide/error-handling.html, https://expressjs.com/en/guide/migrating-5.html, https://expressjs.com/en/advanced/best-practice-security.html, https://expressjs.com/en/support/

### Mistakes to avoid
- Don't: app.get('/*', handler) or app.get('*', handler) → Do: app.get('/*splat', handler), or app.get('/{*splat}', handler) to match / too (In Express 5 the wildcard must have a name.)
- Don't: app.get('/:file.:ext?', handler) → Do: app.get('/:file{.:ext}', handler) (Express 5 dropped the ? for optional parts; braces mark them instead.)
- Don't: res.json({ name }, 201) or res.send(200) → Do: res.status(201).json({ name }) and res.sendStatus(200) (Express 5 removed the old argument orders.)
- Don't: Reading req.body.email with no body reader added → Do: app.use(express.json()) (and express.urlencoded() for HTML forms) before the routes (Without a reader req.body is undefined in Express 5, so the code crashes.)
- Don't: app.use(express.static('public')) for files under public/.well-known → Do: app.use('/.well-known', express.static('public/.well-known', { dotfiles: 'allow' })) (Express 5 hides dot-folders by default, which breaks certificate checks and app links.)

### Questions
- Should I start with Express 4 or 5? Version 5 is the current one (5.3.0) and needs Node.js 18 or newer; both lines still get support, but new projects should use 5.
- Why is req.body undefined? Express reads the request body only after you add a reader, for example app.use(express.json()) for JSON.
- Do async route handlers need try and catch? Not in Express 5. A thrown error or rejected promise goes to your error handler automatically.
- Does Express come with TypeScript types? No. Install @types/express and @types/node as development packages.
- Can I use it in a commercial product? Yes. It is MIT-licensed; keep the license notice with copies of its files.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
