# vue-cli-plugin-mocker

> @vue/cli plugin for mock data

Latest version **0.1.10** (published 2022-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-cli-plugin-mocker
pnpm add vue-cli-plugin-mocker
yarn add vue-cli-plugin-mocker
bun add vue-cli-plugin-mocker
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.10 |
| Published | 2022-01-16 |
| First published | 2021-01-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 33.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | WuYujie |
| Maintainers | coffee377 |
| Keywords | vue, vue3, plugin, @vue/cli, mock, mockjs |

## Links

- npm: https://www.npmjs.com/package/vue-cli-plugin-mocker
- npm.io page: https://npm.io/package/vue-cli-plugin-mocker

## Dependencies (8)

- [glob](https://npm.io/package/glob.md) ^7.1.6
- [express](https://npm.io/package/express.md) ^4.17.1
- [chokidar](https://npm.io/package/chokidar.md) ^3.5.0
- [colors-cli](https://npm.io/package/colors-cli.md) ^1.0.27
- [clear-module](https://npm.io/package/clear-module.md) ^4.1.1
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^6.2.0
- [@babel/register](https://npm.io/package/@babel/register.md) ^7.12.10
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.13.0

## 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
- [@mikemajesty/zod-mock-schema](https://npm.io/package/@mikemajesty/zod-mock-schema.md) — 0 weekly downloads
- [vue-scroll-active-toc](https://npm.io/package/vue-scroll-active-toc.md) — 0 weekly downloads
- [@govuk-pay/run-amock](https://npm.io/package/@govuk-pay/run-amock.md) — 0 weekly downloads

## Recent versions

- 0.1.10 (latest) — 2022-01-16
- 0.1.9 — 2021-04-15
- 0.1.8 — 2021-04-14
- 0.1.8-beta.0 — 2021-04-13
- 0.1.7 — 2021-04-12
- 0.1.6 — 2021-04-08
- 0.1.5 — 2021-03-14
- 0.1.4 — 2021-03-10
- 0.1.3 — 2021-03-10
- 0.1.2 — 2021-02-25
- 0.1.1 — 2021-01-09
- 0.1.0 — 2021-01-09

## README

# vue-cli-plugin-mocker

## Usage

```
vue add mocker
```

or

```
yarn add vue-cli-plugin-mocker -D
npm install vue-cli-plugin-mocker -D

vue invoke mocker
```

## PLUGIN OPTIONS

```typescript
export declare type MockerPluginOption = {
  /**
   * @description mocker 文件目录
   * @default mock
   */
  dir?: string;
  /**
   * @description 是否输出示例文件
   * @default true
   */
  demo?: boolean;
  /**
   * @description 使用mockjs模拟数据
   * @default true
   */
  mock?: boolean | MockerOption;
  [key: string]: any;
};
```

## CHANGE LOG

### 0.1.2
1. 支持函数直接返回 json 数据而不必使用 res.send() 或 res.json()
2. 添加延迟配置参数，用于模拟真实请求环境

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