# auto-mock

> a method to mock data

Latest version **0.1.0** (published 2016-02-02) · ISC license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2016-02-02 |
| First published | 2016-02-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | zhenhua-lee |

## Links

- npm: https://www.npmjs.com/package/auto-mock
- Repository: https://github.com/zhenhua-lee/auto-mock
- Homepage: https://github.com/zhenhua-lee/auto-mock#readme
- Issues: https://github.com/zhenhua-lee/auto-mock/issues
- npm.io page: https://npm.io/package/auto-mock

## Dependencies (1)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1

## Recent versions

- 0.1.0 (latest) — 2016-02-02
- 0.0.3 — 2016-02-02
- 0.0.2 — 2016-02-02
- 0.0.1 — 2016-02-02

## README

## auto data mock

features:

- a method to mock data
- build a map from ajx url to js file
- support mock template
- support schema

usage

	//`opt.mockDir`: assign the palce to store the mock files
	var opt = { mockDir: 'test/mock' };
	var mock = require('auto-mock')(opt)
	var server = http.createServer((req, res) => {
		mock(req, res);
	});
	server.listen(3000, () => {
		console.log('server is on...');
	})
	// if localhost:3000/api/user, test/mock/api/user.js will be builded
	// it is quick to mock data

testing
	
	npm start

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