PROVIDER Β· the most mainstream Node.js web framework
Express
Express is the earliest and most mainstream Node.js framework with only routing and middleware in core, running a REST API in a dozen lines as the entry standard thanks to minimal learning cost and broad compatibility.
Pros
Cons
Product Information
Detailed Notes
Overview
Express was released by TJ Holowaychuk in 2010 and is maintained by the OpenJS Foundation as the earliest and most mainstream Node.js web framework, whose core covers only routing and middleware without imposing structure, ORM, or template engines.
For Programming Languages & Frameworks work the value is minimal learning cost with maximum flexibility, since a REST API runs in a dozen lines, the middleware model composes auth, logging, and error handling as function chains, and nearly every Node tool integrates with it as the base for frameworks like NestJS.
Face the reality, because async error handling needs wrapping despite Express 5 improving Promise support, no validation, ORM, or security is built in, and conservative maintenance leaves performance behind newer frameworks like Fastify.
Core Strengths
- A minimal core running a REST API in a dozen lines
- An intuitive middleware model composing auth, logging, and errors
- The broadest ecosystem compatibility across Node libraries
- The lowest learning cost as the entry standard for Node backends
Product Ecosystem
Core capabilities
Routing with parameter parsing, middleware chains, template integration, static files, and error handling.
Common companions
Mongoose or Prisma for ORM, express-validator, passport for auth, and helmet for security headers.
Deployment
Node processes under PM2 or systemd, or containers behind Nginx.
Drawbacks
- No built-in validation, ORM, or security requiring assembly
- Async errors need manual wrapping with risk of uncaught rejections
- Conservative maintenance leaves performance behind Fastify
- No architectural conventions, so large projects drift
Use Cases
- Lightweight REST APIs (β β β β β ) - The smallest code
- Node onboarding and teaching (β β β β β ) - Clearest concepts
- BFF and gateway layers (β β β β ) - Flexible middleware
- Large structured backends (β β β ) - NestJS fits better
Pricing
| Plan | Price | Scope |
|---|---|---|
| Express framework | $0 | MIT licensed, entirely free |
| Ecosystem middleware | $0 | Open source and free |
| Commercial support | Optional | Via the OpenJS Foundation or vendors |
The framework and middleware are free with cost only in servers and people, and for API services Express uses less memory with faster cold starts than heavy frameworks, lowering container costs.
FAQ
-
Is Express outdated? No, it remains the most widely used Node framework, with Fastify for performance and NestJS for structure.
-
What changed in Express 5? Native Promise rejection handling in async middleware, revised wildcard route syntax, and security fixes, with migrations reviewing route definitions.
-
How is validation done? Through express-validator, zod, or joi in middleware before request parameters are used.
Code Examples
Minimal API service
const express = require('express');
const app = express();
app.get('/api/plans', (req, res) => {
res.json([{ id: 1, name: 'Hong Kong VPS', price: 99 }]);
});
app.listen(3000, () => console.log('http://localhost:3000'));
Install with npm i express and run node app.js with no extra setup.
Middleware and error handling
app.use(express.json());
app.post('/api/plans', (req, res, next) => {
if (!req.body.name) return next(new Error('name is required'));
res.status(201).json(req.body);
});
app.use((err, req, res, next) => {
res.status(400).json({ error: err.message });
});
Community & Resources
Communities and official channels
- Express Site β Guides and API reference
- GitHub expressjs/express β Source, issues, and releases
- Stack Overflow #express β Middleware and routing answers
Learning resources and tools
- Official Middleware List β Common middleware and purpose
- Express Examples β In-repo example code
- Awesome Node.js β The Node ecosystem list