{"id":27923332,"url":"https://github.com/mkeen/rxhttp","last_synced_at":"2025-05-06T22:32:31.263Z","repository":{"id":39759787,"uuid":"141524993","full_name":"mkeen/rxhttp","owner":"mkeen","description":"👋 (Universal) Streaming Fetch HTTP Client Powered by ReactiveX (RxJS)","archived":false,"fork":false,"pushed_at":"2023-01-07T02:24:01.000Z","size":433,"stargazers_count":8,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-06T12:18:05.871Z","etag":null,"topics":["http","http-client","javascript","javascript-library","npm-module","rxjs","rxjs6","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkeen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-19T04:36:58.000Z","updated_at":"2022-08-17T16:44:29.000Z","dependencies_parsed_at":"2023-02-06T10:30:53.460Z","dependency_job_id":null,"html_url":"https://github.com/mkeen/rxhttp","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/mkeen%2Frxhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkeen%2Frxhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkeen%2Frxhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkeen%2Frxhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkeen","download_url":"https://codeload.github.com/mkeen/rxhttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252779313,"owners_count":21802924,"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","http-client","javascript","javascript-library","npm-module","rxjs","rxjs6","typescript"],"created_at":"2025-05-06T22:32:07.859Z","updated_at":"2025-05-06T22:32:31.183Z","avatar_url":"https://github.com/mkeen.png","language":"TypeScript","readme":"# 👋 RxHttp\nHTTP Client that uses Fetch API built with TypeScript that supports real-time JSON streams. It runs in NodeJS and Browser. It's powered by RXJS.\n\n### Why?\nThe Fetch API is the modern API for making http requests -- both long lived (streams) and traditional (simple). And RxJS makes it extremely convenient to build, chain, and consume asyncronous streams. These technologies all compliment each other well enough that it was worth creating this lib.\n\n### Features\n📀 **Universal** -- Works on both NodeJS and Browser\n\n🌊 **Real-time** -- Supports long-lived real-time Chunked JSON streams\n\n🆘 **Complete Observable Lifecycle** -- Simple request lifecycle uses `Observable` callback functions (`next`, `error`, and `complete`). Once the connection completes, or all subscribers have unsubbed, the connection will be cleaned up to ensure there aren't any memory leaks.\n\n### Install\n`npm install @mkeen/rxhttp`  \nhttps://www.npmjs.com/package/@mkeen/rxhttp  \n\n### Generate Docs\n`npm run doc`  \n\n### The Most Bare Bones Example With Defaults \n\n```typescript\nimport { HttpRequest } from '@mkeen/rxhttp';\n\nnew HttpRequest\u003cany\u003e('https://localhost/simple')\n.subscribe(\n  response =\u003e console.log('received response, connection closed', response);\n);\n\n// Output:\n// received response, connection closed , {...}\n```\n\n### Simple (Request/Response) Request Example\n```typescript\nimport { HttpRequest, FetchBehavior } from '@mkeen/rxhttp';\n\ninterface Person {\n  name: string;\n  email: string;\n}\n\nnew HttpRequest\u003cPerson\u003e(\n  'https://localhost/person',\n  { method: 'POST', body: {\n    email: 'mwk@mikekeen.com',\n    name: 'Mike Keen'\n  } }\n)\n.fetch()\n.subscribe(\n  response =\u003e console.log('person created successfully, connection closed', response)\n);\n\n// Output:\n// person created successfully, connection closed, {...}\n```\n\n### Simple (Request/Response) Request With Error Handling Example\n\n```typescript\nimport { HttpRequest, FetchBehavior } from '@mkeen/rxhttp';\n\ninterface Person {\n  name: string;\n  email: string;\n}\n\nnew HttpRequest\u003cPerson\u003e(\n  'https://localhost/person',\n  { method: 'POST', body: {\n    email: 'mwk@mikekeen.com',\n    name: 'Mike Keen'\n  } },\n  FetchBehavior.simple\n)\n.fetch()\n.subscribe(\n (response: Person) =\u003e {\n    console.log('person created successfully, connection closed', response);\n  },\n  \n  (error: any) =\u003e {\n    console.error('http error');\n  },\n  \n  () =\u003e {\n    console.log('connection closed');\n  }\n);\n\n// Output:\n// person created successfully, connection closed, {...}\n```\n\n### \n\n### Streaming Request Example\n\n```typescript\nimport { HttpRequest, FetchBehavior} from '@mkeen/rxhttp';               \n\ninterface Person {\n  name: string;\n  email: string;\n}\n\nconst personStream = new HttpRequest\u003cPerson\u003e(\n  'https://localhost/person', {\n    method: 'GET'\n  }, FetchBehavior.stream\n)\n.fetch()\n.subscribe(\n  (incoming_data: Person) =\u003e {\n    console.log('got person update: ', incoming_data);\n  },\n  \n  (error: any) =\u003e {\n    console.error('http error');\n  },\n  \n  () =\u003e {\n    console.log('connection closed');\n  }\n);\n\n// Output:\n// got person update: , {id: 1 ...\n// got person update: , {id: 2 ...\n// got person update: , {id: 1 ...\n// ...\n```\n\n### License\n\nISC (BSD 2 / MIT) - Enjoy\n\n🇺🇸  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkeen%2Frxhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkeen%2Frxhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkeen%2Frxhttp/lists"}