Express Correlation ID Middleware

JSON →
library 3.0.1 ·javascript
verified May 27, 2026

express-correlation-id is an Express middleware that provides a unique correlation identifier for each incoming HTTP request, ensuring consistency across all asynchronous operations within the request's lifecycle. It automatically generates a UUID if no `x-correlation-id` header is present (or a configurable custom header). The library is currently stable at version 3.0.1, with recent updates indicating active maintenance. Version 3.x introduced a breaking change by requiring Node.js 16 or newer, with Node.js 20 being recommended. Its key differentiators include a simple API to access the ID via both the `req` object (`req.correlationId()`) and a static module method (`correlator.getId()`), as well as the ability to programmatically set the ID. It differentiates itself by its focus on robust async context handling for the correlation ID.

total hits 28
actors 7 distinct systems
last hit 2d ago Amazonbot
Amazonbot
4
MetaBot
4
GPTBot
2
Script
1
Search engines
2
Humans
1

top countries 🇨🇦 Canada · 🇺🇸 United States · 🇪🇸 Spain · 🇫🇷 France · 🇩🇪 Germany