{"id":34686410,"url":"https://github.com/abellsmythe/request-time","last_synced_at":"2026-05-06T00:02:28.335Z","repository":{"id":57094120,"uuid":"206805829","full_name":"abellsmythe/request-time","owner":"abellsmythe","description":"Request Middleware with time metrics","archived":false,"fork":false,"pushed_at":"2019-09-09T19:59:20.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-03T16:01:57.772Z","etag":null,"topics":["javascript","metrics","node-module","nodejs","request","time"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abellsmythe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-06T14:00:04.000Z","updated_at":"2019-09-09T19:59:22.000Z","dependencies_parsed_at":"2022-08-22T19:31:25.081Z","dependency_job_id":null,"html_url":"https://github.com/abellsmythe/request-time","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/abellsmythe/request-time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellsmythe%2Frequest-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellsmythe%2Frequest-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellsmythe%2Frequest-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellsmythe%2Frequest-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abellsmythe","download_url":"https://codeload.github.com/abellsmythe/request-time/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abellsmythe%2Frequest-time/sbom","scorecard":{"id":160478,"data":{"date":"2025-08-11","repo":{"name":"github.com/abellsmythe/request-time","commit":"b3cf6db9a3afc4eca4e71164efe13ef5fbbc0dd3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"40 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T13:16:02.891Z","repository_id":57094120,"created_at":"2025-08-16T13:16:02.891Z","updated_at":"2025-08-16T13:16:02.891Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32672682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","metrics","node-module","nodejs","request","time"],"created_at":"2025-12-24T21:48:03.418Z","updated_at":"2026-05-06T00:02:28.326Z","avatar_url":"https://github.com/abellsmythe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# request-time\n\u003e Timings for HTTP requests\n\nUnderstanding and measuring HTTP timings helps us to discover performance. bottlenecks in client to server or server to server communication.\n\n![Request Timing](./media/request-timing.png \"Request Timing\")\n\n#### Timings explained\n\n- `DNS Lookup`: Time spent performing the DNS lookup. DNS lookup resolves domain names to IP addresses. Every new domain requires a full round trip to do the DNS lookup.\n    - \u003e There is no DNS lookup when the destination is already an IP address.\n\n- `TCP Connection`: Time it took to establish TCP connection between a source host and destination host. Connections must be properly established in a multi-step handshake process. TCP connection is managed by an operating system, if the underlying TCP connection cannot be established, the OS-wide TCP connection timeout will overrule the timeout config of our application.\n\n- `TLS handshake`: Time spent completing a TLS handshake. During the handshake process endpoints exchange authentication and keys to establish or resume secure sessions. \n    - \u003e There is no TLS handshake with a not HTTPS request.\n\n- `Time to First Byte (TTFB)`: Time spent waiting for the initial response. This time captures the latency of a round trip to the server in addition to the time spent waiting for the server to process the request and deliver the response.\n\n- `Content Transfer`: Time spent receiving the response data. The size of the response data and the available network bandwidth determinates its duration.\n\n## Installation\n\nNPM:\n\n\u003e `npm install @abellsmythe/request-time`\n\n\n## Usage\n\n```javascript\n'use strict';\n\nconst https = require('https');\nconst timer = require('@abellsmythe/request-time').default;\n\nconst request = https.get('https://google.com');\nconst timings = timer(request);\n\nrequest.on('response', response =\u003e {\n\tresponse.on('data', () =\u003e {\n        // Do something\n    });\n\tresponse.on('end', () =\u003e {\n\t\tconsole.log(timings);\n\t});\n});\n```\n\n```javascript\n{\n    start: 20019170.414002,\n    socket: 20019171.943738,\n    dnsLookup: 20019182.811348,\n    connect: 20019194.637675,\n    tlsHandshake: 20019245.32874,\n    upload: 20019246.615841,\n    response: 20019284.613933,\n    end: 20019288.80115,\n    error: undefined,\n    phases:\n    {\n        wait: 1.5297359973192215,\n        dns: 10.86761000007391,\n        tcp: 11.826326999813318,\n        request: 51.9781660027802,\n        firstByte: 37.998091999441385,\n        download: 4.187217000871897,\n        total: 118.38714800029993\n    }\n}\n```\n\n## API\n\n### timer(request)\n\nReturns: `Object`\n\n- `start` - Time when the request started.\n- `socket` - Time when a socket was assigned to the request.\n- `dnsLookup` - Time when the DNS lookup finished.\n- `tlsHandshake` - Time when the secure connection is done.\n- `connect` - Time when the socket successfully connected.\n- `upload` - Time when the request finished uploading.\n- `response` - Time when the request fired the `response` event.\n- `end` - Time when the response fired the `end` event.\n- `error` - Time when the request fired the `error` event.\n- `phases`\n\t- `wait` - `timings.socket - timings.start`\n\t- `dns` - `timings.dnsLookup - timings.socket`\n\t- `tcp` - `timings.connect - timings.dnsLookup`\n\t- `request` - `timings.upload - timings.connect`\n\t- `firstByte` - `timings.response - timings.upload`\n\t- `download` - `timings.end - timings.response`\n\t- `total` - `timings.end - timings.start` or `timings.error - timings.start`\n\nIf something is not measured yet, it will be `undefined`.\n\n\u003e **Note**: The time is a `number` representing the milliseconds without elapsing since the UNIX epoch.\n\n\u003e **Note**: `request-time` uses `process.hrtime()` from node as it's not a subject of clock drift","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabellsmythe%2Frequest-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabellsmythe%2Frequest-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabellsmythe%2Frequest-time/lists"}