# mockjs

> 生成随机数据 & 拦截 Ajax 请求

Latest version **1.1.0** (published 2019-10-25) · 0 weekly downloads

## Install

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

Provides the command `random`.

## Health

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

Positive: has types package; high quality score; popular repo.

Warnings: low downloads; no esm support; has vulnerabilities.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-10-25 |
| First published | 2013-09-23 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/mockjs) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.8 MB |
| Known vulnerabilities | 1 |
| Install scripts | no |
| GitHub stars | 19575 |
| Author | nuysoft@gmail.com |
| Maintainers | alvarto, nuysoft |
| Keywords | mock, mockJSON, mockAjax |

## Links

- npm: https://www.npmjs.com/package/mockjs
- Repository: https://github.com/nuysoft/Mock
- Homepage: http://mockjs.com/
- Issues: https://github.com/nuysoft/Mock/issues
- npm.io page: https://npm.io/package/mockjs

## Dependencies (1)

- [commander](https://npm.io/package/commander.md) *

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.0 (latest) — 2019-10-25
- 1.0.1-beta3 — 2016-08-25
- 1.0.1-beta2 — 2016-02-02
- 1.0.1-beta1 — 2016-01-14
- 1.0.0 — 2016-01-12
- 1.0.0-beta1 — 2015-12-14
- 0.1.10 — 2015-06-02
- 0.1.4 — 2014-06-17
- 0.1.2 — 2014-05-14
- 0.1.1 — 2013-09-23

## README

# Mock.js
<!-- 模拟请求 & 模拟数据 -->
[![Build Status](https://travis-ci.org/nuysoft/Mock.svg?branch=refactoring)](https://travis-ci.org/nuysoft/Mock)

<!-- [![Coverage Status](https://coveralls.io/repos/nuysoft/Mock/badge.png?branch=refactoring)](https://coveralls.io/r/nuysoft/Mock?branch=refactoring)
[![NPM version](https://badge.fury.io/js/mockjs.svg)](http://badge.fury.io/js/mockjs)
[![Bower version](https://badge.fury.io/bo/mockjs.svg)](http://badge.fury.io/bo/mockjs)
[![Dependency Status](https://gemnasium.com/nuysoft/Mock.svg)](https://gemnasium.com/nuysoft/Mock)
[![spm package](http://spmjs.io/badge/mockjs)](http://spmjs.io/package/mockjs) -->

Mock.js is a simulation data generator to help the front-end to develop and prototype separate from the back-end progress and reduce some monotony particularly while writing automated tests.

The official site: <http://mockjs.com>

## Features

* Generate simulated data according to the data template
* Provide request/response mocking for ajax requests
* ~~Generate simulated data according to HTML-based templates~~

This library is loosely inspired by Elijah Manor's post [Mocking
Introduction](http://www.elijahmanor.com/2013/04/angry-birds-of-javascript-green-bird.html), [mennovanslooten/mockJSON](https://github.com/mennovanslooten/mockJSON), [appendto/jquery-mockjax](https://github.com/appendto/jquery-mockjax) and [victorquinn/chancejs](https://github.com/victorquinn/chancejs/).

## Questions?
If you have any questions, please feel free to ask through [New Issue](https://github.com/nuysoft/Mock/issues/new).

## Reporting an Issue
Make sure the problem you're addressing is reproducible. Use <http://jsbin.com/> or <http://jsfiddle.net/> to provide a test page. Indicate what browsers the issue can be reproduced in. What version of Mock.js is the issue reproducible in. Is it reproducible after updating to the latest version?

## License
Mock.js is available under the terms of the [MIT License](./LICENSE).

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