Open-Source Wikis

/

Express

/

Express

/

Getting started

expressjs/express

Getting started

This page covers the contributor workflow for the expressjs/express repo itself: how to clone, install, build (there is no build step), test, and run an example. For end-user installation in your own project, see the project Readme or expressjs.com.

Prerequisites

  • Node.js 18 or higher. The engines.node field in package.json is ">= 18". CI runs the test matrix on Node 18, 19, 20, 21, 22, 23, 24, and 25 across Ubuntu and Windows (.github/workflows/ci.yml).
  • npm. No alternative package manager (yarn/pnpm) is configured.
  • git.

There is no TypeScript, no transpilation step, and no bundler. The published package is the source: index.js plus lib/.

Clone and install

git clone https://github.com/expressjs/express.git
cd express
npm install

npm install pulls in 28 runtime dependencies and 14 devDependencies (see package.json). The .npmrc file in the repo root is a single line that may pin install behaviour for the project.

Run the test suite

npm test

This runs Mocha against everything under test/ and test/acceptance/:

mocha --require test/support/env --reporter spec --check-leaks test/ test/acceptance/

Variants:

Command What it does
npm test Standard Mocha run
npm run test-ci nyc + Mocha producing lcov.info (used in CI)
npm run test-cov nyc HTML coverage report at ./coverage/index.html
npm run test-tap Mocha with TAP reporter

The CI matrix (.github/workflows/ci.yml) runs npm run test-ci and uploads coverage to Coveralls.

Lint

npm run lint        # eslint .
npm run lint:fix    # eslint . --fix

ESLint config lives in .eslintrc.yml. Notable rules: 2-space indent (with MemberExpression: off), required eol-last, eqeqeq (allowing == null), and a custom no-restricted-globals rule banning the global Buffer in favour of import { Buffer } from 'node:buffer'.

Run an example

node examples/hello-world

The examples/ directory contains 26 runnable apps (auth, mvc, vhost, content-negotiation, multi-router, etc.) — see examples/README.md for the full list. Each is self-contained and uses the local checkout of Express.

Common workflows

Task Command
Run a single test file npx mocha test/res.send.js
Run tests matching a name npx mocha --grep "res.send" test/
Print the resolved Express version node -p "require('./package.json').version"
Lint a single file npx eslint lib/application.js

Next steps

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Getting started – Express wiki | Factory