{"id":24506130,"url":"https://github.com/alxgmpr/http2wrapper","last_synced_at":"2025-12-29T19:47:22.844Z","repository":{"id":71941827,"uuid":"179763163","full_name":"alxgmpr/http2wrapper","owner":"alxgmpr","description":"2️⃣ NodeJS wrapper that utilizes http2 to make web requests.","archived":false,"fork":false,"pushed_at":"2019-04-06T02:43:53.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T23:34:19.407Z","etag":null,"topics":["http","http2","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/alxgmpr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-05T22:33:46.000Z","updated_at":"2019-06-04T18:42:14.000Z","dependencies_parsed_at":"2023-07-02T18:30:29.842Z","dependency_job_id":null,"html_url":"https://github.com/alxgmpr/http2wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxgmpr%2Fhttp2wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxgmpr%2Fhttp2wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxgmpr%2Fhttp2wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxgmpr%2Fhttp2wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alxgmpr","download_url":"https://codeload.github.com/alxgmpr/http2wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243707303,"owners_count":20334615,"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":["http","http2","nodejs"],"created_at":"2025-01-21T23:33:19.256Z","updated_at":"2025-12-29T19:47:22.798Z","avatar_url":"https://github.com/alxgmpr.png","language":"JavaScript","readme":"# http2wrapper\n\nA quick example of HTTP/2 client requests being implemented in NodeJS.\n\nI was frustrated with the available modules so I decided to make my own set of helpers. \n\n# Example Usage\n\n1) Clone the repository \n\n    `git clone https://github.com/alxgmpr/http2wrapper.git`\n\n2) Navigate to the directory\n\n    `cd http2wrapper`\n    \n3) Run the example script\n\n    `node index.js`\n    \n# Documentation\n\nAll functions return a Promise object that is either resolved with a response or rejected with an error.\n\n* `get(url: string, headers?: object, timeout?: integer)` (signature is identical for `_delete()`)\n\n    * `url` - the full location of the desired resource\n    * `headers` - optional additional headers for the request\n    * `timeout` - optional millisecond timeout before rejecting the promise (default is 10000ms)\n    \n* `post(url: string, headers?: object, body?: string, timeout?: integer)` (signature is identical for `put()`)\n   \n    * `url` - the full location of the desired resource\n    * `headers` - optional additional headers for the request\n    * `body` - optional request body. This must be a raw string (it is up to the user to serialize JSON and form bodies)\n    * `timeout` - optional millisecond timeout before rejecting the promise (default is 10000ms)\n    \nResponses are object literals structured as such:\n```\n{\n    headers: {},\n    flags: 0,\n    body: ''\n}\n```\nJust like request bodies, parsing is left up to the user.\n\n    \n# Notes, Contribution\n\n* The `:path` and `:scheme` and `:authority` headers are all determined from the URL string parameter. Thus it's necessary\nto ensure that URL's are not malformed and should be in the format `https://host/path/to/resource`.\n* These functions are *very* basic and are only intended as a 'proof of concept' implementation. They have several\nshortcomings including but not limited to:\n    * Not taking advantage of concurrent connectivity provided with HTTP/2\n    * Poor error handling\n    * Low level processing of request/response bodies\n* In the future, I'd like to add:\n    * [ ] HTTP/1.1 fallback for servers failing to use HTTP/2\n    * [ ] Persistent sessions (currently sessions are terminated after each request)\n    * [ ] More HTTP methods\n    * [ ] Descriptive and dynamic error handling (including following 3XX redirects)\n    * [ ] Deploy as an npm package\n    * [ ] Stream support\n    * [ ] External proxy support\n    * [ ] Custom SSL certificates\n* Please feel free to fork this repository to make your own implementation. I dont have a strict idea of guiding\ncontribution, so... go crazy.\n\n# MIT License\n\nCopyright 2019 Alexander Gompper\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxgmpr%2Fhttp2wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falxgmpr%2Fhttp2wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxgmpr%2Fhttp2wrapper/lists"}