Package Configuration
This page documents the configuration surfaces defined in the Express package.json file, including runtime dependencies, development scripts, Node.js version requirements, and publishing conventions.
Node.js Version Requirement
Express requires Node.js >= 18. This constraint is declared in the engines field of package.json and is enforced by the npm package manager during installation. The CI workflows reflect this requirement by testing against Node.js versions 18 through 26 in the main test matrix .github/workflows/ci.yml:27-28.
A separate legacy CI workflow tests Node.js versions 16 and 17, which are no longer supported by the main CI pipeline .github/workflows/legacy.yml:16-17.
Runtime Dependencies
Express declares the following runtime dependencies in package.json. These packages are installed automatically when a consumer runs npm install express.
| Dependency | Purpose |
|---|---|
accepts | Content negotiation (Accept header parsing) |
body-parser | HTTP request body parsing |
content-disposition | Content-Disposition header parsing |
content-type | Content-Type header parsing |
cookie | Cookie parsing and serialization |
cookie-signature | Cookie signing and verification |
debug | Debug logging utility |
depd | Deprecation warning utility |
encodeurl | URL encoding |
escape-html | HTML entity escaping |
etag | HTTP ETag generation |
finalhandler | Final request handler for error responses |
fresh | HTTP freshness checking (If-None-Match / If-Modified-Since) |
http-errors | HTTP error object creation |
merge-descriptors | Property descriptor merging |
mime-types | MIME type lookup |
on-finished | HTTP request/response completion callback |
once | One-time function execution wrapper |
parseurl | URL parsing with caching |
proxy-addr | Proxy address detection and trust configuration |
These dependencies cover Express's core responsibilities: request parsing, response formatting, error handling, security (cookie signing, HTML escaping), and network utilities.
Development Scripts
The scripts section of package.json provides the following commands for local development and CI:
| Script | Command | Purpose |
|---|---|---|
lint | (defined in package.json) | Run the linter to check code style and quality |
lint:fix | (defined in package.json) | Run the linter and automatically fix issues |
test | (defined in package.json) | Run the test suite |
test-ci | (defined in package.json) | Run tests in CI mode (typically with coverage) |
test-cov | (defined in package.json) | Run tests with code coverage reporting |
test-tap | (defined in package.json) | Run tests with TAP output format |
The CI workflows use npm run lint for the lint job and npm run test-ci for the test jobs .github/workflows/ci.yml:18-19.github/workflows/ci.yml:47-48.
Package Manager
Express uses npm (or any compatible package manager) for dependency management. The CI workflows install dependencies with npm install and configure the npm log level to error to reduce verbosity during CI runs .github/workflows/ci.yml:37-39.
Publishing
The package.json does not include a publishConfig or files field in the provided material. Express follows standard npm publishing conventions:
- The package is published to the npm registry under the name
express. - The
mainentry point isindex.js(as indicated by the top-level file listing). - The
versionfield follows semantic versioning.
No custom publish scripts or pre-publish hooks are defined in the provided material.
CI Workflow Integration
The package configuration directly influences the CI workflows:
-
Dependency installation: All CI workflows run
npm install(ornpm install --ignore-scripts --include=devfor the lint job) to install dependencies.github/workflows/ci.yml:16-17.github/workflows/ci.yml:41-42. -
Test execution: The
test-ciscript is used in CI instead oftest, allowing CI-specific behavior (e.g., different reporter output).github/workflows/ci.yml:47-48. -
Linting: The
lintscript is executed in a dedicated lint job that runs on the latest LTS Node.js version.github/workflows/ci.yml:18-19. -
Coverage: Test coverage artifacts (lcov.info files) are uploaded and merged across all test matrix entries, then reported to Coveralls
.github/workflows/ci.yml:50-70.
Related Pages
- Overview
- Architecture
- CI Workflows
- Package Configuration (this page)