Provides performance timings for HTTP requests in Node.js. Useful for measuring key phases like DNS lookup, socket connection, upload, first byte, download, total time, and exposes these as `request.timings`/`response.timings`, with notes about how timings map to Node.js events and how large upload chunks can affect upload and response timings.
Project status
- The repository appears quiet and effectively in maintenance mode, with the last upstream update on 2021-08-20, which is well over four years ago relative to 2026-08-12.
- There is no evidence of an ongoing or recent update cadence, as the most recent updates shown (v5.0.1 and v5.0.0) are clustered in 2021, with no subsequent activity indicated.
AI summary generated
Recent updates
v5.0.1
Release v5.0.1 does not include any published release notes. The code diff is small (2 files changed) and shows a change in how Node.js built-in modules are imported, plus a minor ESLint configuration update.
v5.0.0
v5.0.0 makes @szmarczak/http-timer pure ESM and raises the minimum supported Node.js version to >=14.16. The code also changes how it records request error timing by switching to Node's errorMonitor and adjusting lifecycle cleanup around abort/end events.
Breakingv4.0.6
v4.0.6 improves how http request timing data is collected by reusing a previously computed timings object on repeated `timer(request)` calls, and it adjusts behavior for aborted responses and Proxy-wrapped sockets. The code also adds additional event handling to capture `aborted` on the response stream and skips socket phase measurement when the underlying socket is proxied.
Featuresv4.0.5
v4.0.5 is a small patch release that addresses incorrect handling of request abort timing on Node.js 13. The code change adjusts when the library sets the total timing phase during an abort sequence, and the test suite was updated to reflect the new behavior.
v4.0.4
Release v4.0.4 updates @szmarczak/http-timer to correct how the `total` timing phase is calculated when a request is aborted after the `response` event has already been emitted. It adjusts the abort handler logic and extends the test suite to cover the post-`response` abort scenario.
v4.0.3
Release v4.0.3 primarily targets improved compatibility with Node.js 10. The code change adjusts how the library determines when an HTTP request upload has finished so upload timing is computed more reliably.
v4.0.2
v4.0.2 updates @szmarczak/http-timer to support measuring request timings correctly when HTTP sockets are reused (keep-alive). The code changes adjust when socket and upload phase timestamps are captured, and the package build/publish configuration and dependencies were also updated.
Featuresv4.0.0
v4.0.0 adds timing capture for the HTTP request abort event, including a new abort timestamp and a total duration derived from end, error, or abort. The implementation also refactors TypeScript typings, moving from implicit augmentation of Node's http types to explicitly exported interfaces for ClientRequest and IncomingMessage with timings.
BreakingFeaturesv3.1.0
v3.1.0 adds the ability to access the computed timing object directly from both the outgoing request and the incoming response. The release notes document the new `request.timings` and `response.timings` properties, and the code implements those attachments.
Featuresv3.0.0
v3.0.0 raises the minimum Node.js version to 10 and adds additional HTTPS timing data, including a new secureConnect timestamp and a tls phase in the computed phase durations. It also updates the module export shape to better support CommonJS default imports. The code diff also reveals a change to how the existing phases.request duration is calculated for HTTPS requests.
BreakingFeatures