# http-rx

> A reactive http client based on Observable and Request

Latest version **2.1.10** (published 2025-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-rx
pnpm add http-rx
yarn add http-rx
bun add http-rx
```

## Health

**Score 33/100 (F)** — status: maintenance-mode.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.10 |
| Published | 2025-03-20 |
| First published | 2018-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/http-rx) |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 2 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Viacheslav Moskalenko |
| Maintainers | jasonrammoray |
| Keywords | Rx, http, Observable |

## Links

- npm: https://www.npmjs.com/package/http-rx
- Repository: https://github.com/JasonRammoray/HttpRx
- Homepage: https://github.com/JasonRammoray/HttpRx#readme
- Issues: https://github.com/JasonRammoray/HttpRx/issues
- npm.io page: https://npm.io/package/http-rx

## Dependencies (2)

- [rxjs](https://npm.io/package/rxjs.md) ^6.5.5
- [request](https://npm.io/package/request.md) ^2.88.2

## Recent versions

- 2.1.10 (latest) — 2025-03-20
- 2.1.9 — 2024-07-14
- 2.1.8 — 2023-01-08
- 2.1.7 — 2022-04-12
- 2.1.6 — 2021-12-21
- 2.1.5 — 2021-07-06
- 2.1.4 — 2021-05-11
- 2.1.3 — 2021-05-07
- 2.1.2 — 2021-02-21
- 2.1.1 — 2020-09-22
- 2.1.0 — 2020-04-20
- 2.0.8 — 2019-12-29
- 2.0.7 — 2019-09-04
- 2.0.6 — 2019-07-14
- 2.0.5 — 2019-06-12
- … 15 more at https://npm.io/package/http-rx/versions

## README

![Travis build](https://travis-ci.org/JasonRammoray/HttpRx.svg?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/6be09fcb78891730bfc1/maintainability)](https://codeclimate.com/github/JasonRammoray/HttpRx/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/6be09fcb78891730bfc1/test_coverage)](https://codeclimate.com/github/JasonRammoray/HttpRx/test_coverage)
![npm statistic](https://nodei.co/npm/http-rx.png?downloads=true&downloadRank=true&stars=true)
## HttpRx
A JavaScript library wrapping best of Observable and Request.
No more, no less.

It does only one thing and does it very well - provides a possibility to execute http requests in reactive manner.

It *does not* break http semantics.

See live demo [*HERE*](https://runkit.com/l2jliga/5b2c00bf17259600121348f2).

This means, that everything with status code less than 400 is considered to be a success and everything with status code more or equal to 400 is considered to be an error.
## Examples
```js
const httpRx = require('http-rx');
const { map, catchError, finalize } = require('rxjs/operators');
const userName = 'jasonrammoray';
const url = `https://api.github.com/users/${userName}`;
httpRx.get(url, {
    headers: {
      'User-Agent': 'Test user Agent'
    },
    json: true
})
.pipe(
    map(data => data.body.bio),
    catchError(error => console.error('Can not obtain user data, because: ', error)),
    finalize(() => console.info('GitHub user data fetching procedure is done'))
)
.subscribe(userBio => console.log(`GitHub user bio is: ${userBio}`));
```

## Pull-requests
Rules are simple:
* cover your changes with tests
* make sure, that your code complies with coding standards in the project

---
_Source: https://npm.io/package/http-rx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
