Node.js HTTP Request Statistics
JSON →request-stats is a Node.js library designed to collect detailed statistics on HTTP server requests and responses. It tracks metrics such as total request duration, bytes sent by the client, bytes sent back to the client, request headers, HTTP method, request path, remote IP address, and the HTTP status code of the response. The current stable version, as of the provided information, is 3.0.0. The package emits two primary events: `request`, which fires when a request begins and provides a special `Request` object for monitoring progress, and `complete`, which fires when a request concludes and delivers a comprehensive `stats` object. A key differentiator of `request-stats` is its unique `.progress()` method available on the `Request` object, allowing developers to periodically query for real-time statistics of long-running requests, including incremental deltas since the last query. This capability goes beyond simple request completion tracking, offering deeper insights into in-flight request performance. The library supports attaching to an entire Node.js `http.Server` instance or to individual `http.IncomingMessage` and `http.ServerResponse` pairs.
Traffic · last 30 days ↓50% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany