expressjs / expressjs/response-time

Add support for request-received middleware

Open
#19 4 comments 0 reactions 0 assignees View on GitHub
ideas
Dominant language
JavaScript
Stars
497
Forks
74
PR merge metrics
No merged PRs in 30d

Description

The `request-received` middleware at https://github.com/cabinjs/request-received exposes a `Symbol.for` property, which this package could conditionally consume if interested (as opposed to just generating `process.hrtime()`.

e.g. https://github.com/expressjs/response-time/blob/master/index.js#L53 would change from `var startAt = process.hrtime()` to `var startAt = req[Symbol.for('request-received.startAt')] ? req[Symbol.for('request-received.startAt')] : process.hrtime()`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.