# trashdispenser

> Quickly mock server responses

Latest version **0.0.3** (published 2016-10-04) · MIT license · 0 weekly downloads

## Install

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

Provides the command `trashdispenser`.

## 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.3 |
| Published | 2016-10-04 |
| First published | 2016-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James Frost |
| Maintainers | jamesfrosty |
| Keywords | mock, server, response |

## Links

- npm: https://www.npmjs.com/package/trashdispenser
- Repository: https://github.com/JamesFrost/trashdispenser
- Homepage: https://github.com/JamesFrost/trashdispenser#readme
- Issues: https://github.com/JamesFrost/trashdispenser/issues
- npm.io page: https://npm.io/package/trashdispenser

## Dependencies (3)

- [cwd](https://npm.io/package/cwd.md) 0.10.0
- [restify](https://npm.io/package/restify.md) 4.1.1
- [update-notifier](https://npm.io/package/update-notifier.md) 1.0.2

## 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
- [mock-api-studio-cli](https://npm.io/package/mock-api-studio-cli.md) — 0 weekly downloads
- [@ireneliaoliao/vite-plugin-mock](https://npm.io/package/@ireneliaoliao/vite-plugin-mock.md) — 0 weekly downloads
- [fakenamely](https://npm.io/package/fakenamely.md) — 0 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2016-10-04
- 0.0.2 — 2016-10-04
- 0.0.1 — 2016-10-03

## README

# trashdispenser
Quickly create a server to mock responses :poop:

```bash
npm install -g trashdispenser
```
Built using <a href="https://www.npmjs.com/package/restify">Restify</a>.
## Usage
### Command Line
```bash
trashdispenser config.json
```
Where 'config.json' is a file containing configuration.
### Code
```js
var trashdispenser = require( 'trashdispenser' );

trashdispenser.dispense( config, function( server ) // callback optional
{
  // server is a restify server object
});
```
## Config
```json
{
	"url" : "yourservers.url.com",
	"port" : 8080,
	"endPoints" :
	[
		{
			"uri" : "/an/endpoint/:environment",
			"method" : "get",
			"data" :
			[
				"random data",
				"more random data"
			]
		},
        {
			"uri" : "/another/:endpoint",
			"method" : "get",
			"data" :
			[
				"random data",
				"more random data"
			]
		}
	] 
}
```
Data returned from requests is chosen randomly from the data array.

If url attribute is not set, will default to local host.

## License
MIT

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