Express.js: Minimalist Web Framework for Node.js
Express.js is a minimalist web framework for Node.js that adds routing, middleware, and HTTP helpers without dictating your app's structure. The GitHub repo shows an MIT license and a maintained guide for migrating from v4 to v5. Reach for it when you want a thin, unopinionated layer over Node's HTTP module and are willing to pick your own ORM and template engine; skip it if you want those decisions made for you out of the box.
What is Express.js?
Express.js is a web framework for Node.js that sits on top of Node's built-in HTTP module and adds routing, middleware support, and HTTP helpers like redirects and cache headers. The README notes it doesn't force a specific ORM or template engine; its view layer plugs into 14+ template engines through @ladjs/consolidate. Express.js was originally authored by TJ Holowaychuk and is now maintained under the expressjs GitHub organization.
Core Features of Express.js
- โA routing system that maps HTTP methods and URL paths to handler functions.
- โHTTP helper methods for things like redirects and cache headers, so you don't write that logic by hand for every route.
- โContent negotiation, so a single route can respond differently depending on what the client accepts.
- โA view layer that plugs into 14+ template engines through @ladjs/consolidate instead of shipping one built-in engine.
- โThe express-generator executable, which scaffolds a starter app layout with one command.
- โWhat the README calls "super-high" test coverage, backed by a Coveralls badge in the repo.
Who Benefits from Express.js?
Backend developers building an HTTP API, a server-rendered website, or a single-page app's backend get the most out of Express.js, since the README frames it for exactly those cases: single page applications, websites, hybrids, and public HTTP APIs. It also suits teams that want to choose their own ORM, template engine, and folder structure rather than inherit a framework's conventions. Teams that want a prescribed project structure and built-in tooling out of the box should look elsewhere.
How to Install Express.js
Express.js is distributed as an npm package, so you need Node.js installed first. The README specifies Node.js 18 or higher. If this is a brand-new project, run `npm init` to create a package.json, then install with `npm install express`. For a scaffolded starting point instead of a bare package, install the generator globally with `npm install -g express-generator@4` (its major version tracks Express.js's own), then run `express /tmp/foo && cd /tmp/foo`, `npm install`, and `npm start`.
Building Your First Express.js App
The minimal app is a handful of lines: import express, create an app, define a route, and call listen. ```js 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') }) ``` Run that file with Node and open http://localhost:3000 to see the response. If you scaffolded with express-generator instead, `npm start` boots the generated app the same way. Moving an existing v4 app to v5 has its own migration guide linked from the README.
Strengths
- โAdds routing, middleware, and HTTP helpers directly on Node.js's HTTP module without forcing an ORM or template engine choice.
- โSupports 14+ template engines through @ladjs/consolidate, so you're not locked into one view layer.
- โMIT licensed, with no restrictions on commercial use.
- โShips a generator executable (express-generator) for scaffolding a new app in a few commands.
- โHas a documented migration guide for moving from v4 to v5 instead of leaving breaking changes unexplained.
Understanding Express.js's Design Choices
- โณNo built-in ORM or template engine. You pick and configure your own instead of inheriting a default.
- โณThe README's "high performance" framing isn't backed by any measurable data in the source, so take it as a design goal rather than a verified claim.
- โณNode.js 18 or higher is required, which rules out projects still pinned to older Node runtimes.
- โณMoving from v4 to v5 means following a dedicated migration guide, so breaking changes exist between major versions.
- โณBeing unopinionated cuts both ways: routing conventions, error handling patterns, and folder structure aren't enforced by the framework, so you either set them yourself or lean on third-party middleware to fill the gap.
Frameworks Similar to Express.js
Common Questions About Express.js
Express.js is released under the MIT license, per its GitHub repository, which permits commercial use without licensing fees.
Express.js is written in JavaScript, the language GitHub lists for the expressjs/express repository.
Express.js's README frames it for single page applications, server-rendered websites, hybrid apps, and public HTTP APIs, since it supplies routing and HTTP helpers without forcing a particular front-end approach.
Express.js requires Node.js 18 or higher, according to the installation section of its README.
Express.js supports more than 14 template engines through the @ladjs/consolidate library, and it doesn't lock you into any single one.
Express.js's documentation lives at expressjs.com, with GitHub Discussions for development and usage questions and the expressjs GitHub organization hosting official middleware and modules.
The problem it solves
Node.js's built-in http module hands you a raw request and response object and nothing else: no router, no shortcut for sending JSON, no content negotiation. Express.js's own tagline calls it fast, unopinionated, and minimalist. In practice that means a thin layer of routing, HTTP helpers, and middleware support sitting directly on Node's HTTP module, instead of a fuller-stack framework that also picks your ORM and template engine for you.
Best use cases
- โขBacking a single-page app's API layer with routing and JSON responses, without inheriting a larger framework's folder conventions.
- โขServing a server-rendered website by pairing Express.js's routing with one of the 14+ template engines it supports.
- โขBuilding a public HTTP API that needs content negotiation and HTTP helpers like redirects and cache headers.
- โขScaffolding a new project quickly with the express-generator executable instead of hand-wiring the initial folder structure.
Related repositories
Curious whether express is right for you?
Let ChatGPT, Claude, or Perplexity look into it โ click below and see what AI actually says about express.
