# mock-plus

> more convenient to generate data for front-end testing

Latest version **0.0.1** (published 2014-11-06) · 0 weekly downloads

## Install

```sh
npm install mock-plus
pnpm add mock-plus
yarn add mock-plus
bun add mock-plus
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-11-06 |
| First published | 2014-11-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ruby |
| Maintainers | ruby |

## Links

- npm: https://www.npmjs.com/package/mock-plus
- Repository: https://github.com/rubyisapm/mock-plus
- Issues: https://github.com/rubyisapm/mock-plus/issues
- npm.io page: https://npm.io/package/mock-plus

## Dependencies (3)

- [mace](https://npm.io/package/mace.md) ^2.0.0
- [mockjs](https://npm.io/package/mockjs.md) ^0.1.4
- [json-parser](https://npm.io/package/json-parser.md) ^0.2.4

## Recent versions

- 0.0.1 (latest) — 2014-11-06
- 0.0.3 (0.0.3) — 2014-11-12
- 0.0.2 (0.0.2) — 2014-11-07

## README

mock-plus
===========

mock-plus is a encapsulation of mockjs, it will be more convenient to use mockjs with it.

> * toDoc(input, output)<br/>
Aim to generate documentation to describe your interface<br/>
input: give the path of your json file<br/>
output: give the path where you wanna save the documentation<br/>

> * toMock(input, output)<br/>
Aim to generate mock template<br/>
input: give the path of your josn file<br/>
output: give the paht where you wanna save the template<br/>

> * generator(input, output)<br/>
Aim to generate mock data for testing<br/>
input: give the path of your json file<br/>
output: give the path where you wanna save the mock data<br/>

> * config(ops)<br/>
Config the default rule for every type of data.<br/>
According to mockjs, the types include: boolean, integer, float, string, array, object. Visit [mockjs](http://mockjs.com/) for detail.<br/>

>* getRule()<br/>
You can use this method to see what default rules you will use to generate the mock data.

####You should know:
> * There is no default rules for array or object, <br/>
because that may cause some unexpected problems such as some attributes get lost.<br/>
so, be careful if you wanna add default rule for array or object.<br/>

based on [mace](https://github.com/lichenhao/mace)、[json-parser](https://github.com/kaelzhang/node-json-parser)、[mockjs](https://github.com/nuysoft/Mock)

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