# mockios

> A library that helps run-time testing by putting fake data instead of Axios.

Latest version **1.2.4** (published 2023-01-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install mockios
pnpm add mockios
yarn add mockios
bun add mockios
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2023-01-24 |
| First published | 2022-12-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chanwoo00106 |
| Maintainers | bestteemo |
| Keywords | axios, mock |

## Links

- npm: https://www.npmjs.com/package/mockios
- Repository: https://github.com/chanwoo00106/mockios
- Issues: https://github.com/chanwoo00106/mockios/issues
- npm.io page: https://npm.io/package/mockios

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.2.3

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [create-protoyard](https://npm.io/package/create-protoyard.md) — 0 weekly downloads
- [protoyard](https://npm.io/package/protoyard.md) — 0 weekly downloads
- [ppspy-mcp-server](https://npm.io/package/ppspy-mcp-server.md) — 0 weekly downloads

## Recent versions

- 1.2.4 (latest) — 2023-01-24
- 1.2.3 — 2023-01-22
- 1.2.2 — 2023-01-21
- 1.2.1 — 2023-01-19
- 1.2.0 — 2023-01-19
- 1.1.3 — 2022-12-29
- 1.1.2 — 2022-12-27
- 1.1.1 — 2022-12-27
- 1.1.0 — 2022-12-27
- 1.0.4 — 2022-12-27
- 1.0.3 — 2022-12-27
- 1.0.2 — 2022-12-26
- 1.0.1 — 2022-12-26
- 1.0.0 — 2022-12-26

## README

# mockios

A library that helps run-time testing by putting fake data instead of Axios.

## Installing

When use `npm`

```
$ npm install --save-dev mockios
```

When use `yarn`

```
$ yarn add --dev mockios
```

## How to use

[CodeSandBox example](https://codesandbox.io/s/mockios-example-xsjhhg)

```typescript
import axios from "axios";
import mockios, { MockDataType } from "mockios";

const mockData: MockDataType = {
  get: {
    // method
    "/hello": [
      // url
      { ok: true, message: "hello world" }, // response body
      { baseURL: "http://localhost:3000" }, // response config
    ],
  },
};

const query =
  process.env.NODE_ENV === "development" ? mockios(mockData) : axios;

query.get("/hello").then(({ data }) => {
  console.log(data); // { ok: true, message: 'hello world' }
});
```

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