# http-request-mock

> Intercept & mock http requests issued by XMLHttpRequest, fetch, nodejs https/http module, axios, jquery, superagent, ky, node-fetch, request, got or any other request libraries by intercepting XMLHttpRequest, fetch and nodejs native requests in low level.

Latest version **2.0.2** (published 2024-10-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-request-mock
pnpm add http-request-mock
yarn add http-request-mock
bun add http-request-mock
```

Provides the commands `http-request-mock`, `http-request-mock-cli`.

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2024-10-16 |
| First published | 2021-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^12.18.0 \|\| >=14.13.1 |
| Dependencies | 6 |
| Unpacked size | 3.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 73 |
| Author | shuilonghu |
| Maintainers | huturen |
| Keywords | xhr mock, XMLHttpRequest mock, xhr-mock, fetch mock, fetch-mock, wx.request mock, response mock, ajax mock, AJAX mock, ajax-mock, intercept, interceptor, http mock, https mock, request mock, mock, network mock, network-mock, mocking, mocks, mocker, interceptor, http interceptor, http mock, http-interceptor, http-mock, http request, https request, fetch interceptor, fetch-interceptor, xhr interceptor, xhr-interceptor, low level interceptor, node-http-mock, node-http-request-mock, request mock, request mocks, request-mock, request-mocks, axios mock, fetch mock, jquery mock, got mock, superagent mock, ky mock |

## Links

- npm: https://www.npmjs.com/package/http-request-mock
- Repository: https://github.com/huturen/http-request-mock
- Homepage: https://huturen.github.io/http-request-mock-docs/
- Issues: https://github.com/huturen/http-request-mock/issues
- npm.io page: https://npm.io/package/http-request-mock

## Dependencies (6)

- [chokidar](https://npm.io/package/chokidar.md) ^3.5.2
- [commander](https://npm.io/package/commander.md) ^12.1.0
- [http-proxy](https://npm.io/package/http-proxy.md) ^1.18.1
- [@ngneat/falso](https://npm.io/package/@ngneat/falso.md) ^4.0.0
- [follow-redirects](https://npm.io/package/follow-redirects.md) ^1.15.0
- [@types/follow-redirects](https://npm.io/package/@types/follow-redirects.md) ^1.14.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2024-10-16
- 2.0.1 — 2024-09-07
- 2.0.0 — 2024-09-07
- 1.8.28 — 2024-08-17
- 1.8.27 — 2024-08-10
- 1.8.26 — 2024-07-28
- 1.8.25 — 2024-07-04
- 1.8.24 — 2024-06-10
- 1.8.23 — 2024-06-10
- 1.8.22 — 2024-06-10
- 1.8.21 — 2024-06-10
- 1.8.20 — 2024-06-10
- 1.8.19 — 2024-05-07
- 1.8.18 — 2024-02-18
- 1.8.17 — 2023-07-13
- … 175 more at https://npm.io/package/http-request-mock/versions

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