# quick-mock

> The easiest way to create mock APIs.

Latest version **0.0.6** (published 2017-01-27) · ISC license · 0 weekly downloads

## Install

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

Provides the command `quick-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.0.6 |
| Published | 2017-01-27 |
| First published | 2017-01-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.9.0 |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+12 in 2 direct dependencies) |
| Install scripts | no |
| Author | Joshua Kemmerling |
| Maintainers | hellojosh |
| Keywords | apis, mock |

## Links

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

## Dependencies (6)

- [faker](https://npm.io/package/faker.md) 3.1.0
- [lodash](https://npm.io/package/lodash.md) 4.17.4
- [express](https://npm.io/package/express.md) 4.14.0
- [nodemon](https://npm.io/package/nodemon.md) 1.11.0
- [optimist](https://npm.io/package/optimist.md) 0.6.1
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^1.7.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
- [@bcc-code/db_masker](https://npm.io/package/@bcc-code/db_masker.md) — 0 weekly downloads
- [mocksimple](https://npm.io/package/mocksimple.md) — 0 weekly downloads
- [@react-shimeji/character-red-medic-by-tesspy-665b23](https://npm.io/package/@react-shimeji/character-red-medic-by-tesspy-665b23.md) — 0 weekly downloads

## Recent versions

- 0.0.6 (latest) — 2017-01-27
- 0.0.5 — 2017-01-27
- 0.0.4 — 2017-01-26
- 0.0.3 — 2017-01-26
- 0.0.2 — 2017-01-26
- 0.0.1 — 2017-01-26

## README

# Quick Mock

`quick-mock` is the easiest way to create mock APIs.

## Installing

Installation via `npm`:

	npm install quick-mock -g

## Usage

### Starting quick mock

	quick-mock

### Available options

`-p` Port to use (defaults to `8080`)

`-a` Address to user (defaults to `localhost`)

`-c` Directory of URL JSON file (defaults to `../config.json`)

`-h` Prints this list of options

## URL JSON file

This file contains all of the paths that will be mocked. The file will contain an array of object. Each object is a route and can contain any type of values. Each string value is a key that refers to a `faker.js` function.

Here is an example:

	[
		{ "url": "/names", "method": "get", "return": "zipCode", "count": 5 },
		{ "url": "/self", "method": "get", "return": { "zipCode": "zipCode", "name": [ "streetAddress", { "country": "country" }, "zipCode" ] }, "count": 5, "single": true }
	]

### Route options

`url` - This is the mocked route (defaults to /)

`method` - The HTML verb for the route (defaults to get)

`return` - This is the object that gets returned (defaults to an empty string)

`count` - The number of objects returned (defaults to 1)

`single` - If set to true, the route will return an single object instead of an array (defaults to false)

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