{"id":13447327,"url":"https://github.com/bcoe/http2spy","last_synced_at":"2026-03-16T13:03:19.305Z","repository":{"id":35054803,"uuid":"201158838","full_name":"bcoe/http2spy","owner":"bcoe","description":"test helpers for working with Node.js' http2 module","archived":false,"fork":false,"pushed_at":"2025-03-11T22:57:23.000Z","size":41,"stargazers_count":19,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T23:32:06.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcoe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-08T02:01:56.000Z","updated_at":"2022-08-13T10:42:16.000Z","dependencies_parsed_at":"2024-01-18T15:58:56.708Z","dependency_job_id":"6ee6bc19-648a-486b-a88c-9374d4a7fb7e","html_url":"https://github.com/bcoe/http2spy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcoe%2Fhttp2spy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcoe%2Fhttp2spy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcoe%2Fhttp2spy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcoe%2Fhttp2spy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcoe","download_url":"https://codeload.github.com/bcoe/http2spy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243809865,"owners_count":20351403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T05:01:14.061Z","updated_at":"2026-03-16T13:03:14.258Z","avatar_url":"https://github.com/bcoe.png","language":"TypeScript","readme":"# http2spy\n\n[![Build Status](https://travis-ci.org/bcoe/http2spy.svg?branch=master)](https://travis-ci.org/bcoe/http2spy)\n![nycrc config on GitHub](https://img.shields.io/nycrc/bcoe/http2spy)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n\n\nSpy on nodejs' built-in [http2 module](https://nodejs.org/api/http2.html) and\nassert against requests that have been performed:\n\n```js\nconst assert = require(\"assert\");\nconst http2spy = require(\"http2spy\");\nconst myClient = http2spy.require(require.resolve(\"./lib/my-client\"));\n\n// do something with your http2 API client, e.g.,\n// client.request({ \":method\": \"GET\", \":path\": \"/\" });\n\n// now examine the requests:\nassert.strictEqual(http2spy.requests[0][\":method\"], 'GET');\n```\n\n## Passing Additional Stubs\n\nhttp2spy is just a thin wrapper on top of\n[proxyquire](https://www.npmjs.com/package/proxyquire), if you would like to\npass additional libraries to stub, simply provide them as a second parameter:\n\n```js\nconst myClient = http2spy.require(require.resolve(\"./lib/my-client\"), {\n  'second-library': {\n    foo: () =\u003e {}\n  }\n});\n```\n\n## License\n\nApache Version 2.0\n\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcoe%2Fhttp2spy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcoe%2Fhttp2spy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcoe%2Fhttp2spy/lists"}