# qookiemonster

> Stateless fake API based on cookie processing

Latest version **0.1.0** (published 2023-04-15) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-04-15 |
| First published | 2023-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | qiwibot |
| Keywords | fake, stub, mock, api, fakeapi, cookie, cookiemonster |

## Links

- npm: https://www.npmjs.com/package/qookiemonster
- Repository: https://github.com/qiwi/cookiemonster
- Homepage: https://github.com/qiwi/cookiemonster#readme
- Issues: https://github.com/qiwi/cookiemonster/issues
- npm.io page: https://npm.io/package/qookiemonster

## Dependencies (1)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.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
- [@newmo/eslint-plugin-graphql-fake](https://npm.io/package/@newmo/eslint-plugin-graphql-fake.md) — 0 weekly downloads
- [steamspy-mcp](https://npm.io/package/steamspy-mcp.md) — 0 weekly downloads
- [mockhttpkit](https://npm.io/package/mockhttpkit.md) — 0 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2023-04-15
- 0.0.1 — 2023-04-15

## README

# qookiemonster
[![CI](https://github.com/qiwi/cookiemonster/actions/workflows/ci.yaml/badge.svg?branch=master&event=push)](https://github.com/qiwi/cookiemonster/actions/workflows/ci.yaml)
[![Maintainability](https://api.codeclimate.com/v1/badges/01b67bf5bc60a67df296/maintainability)](https://codeclimate.com/github/qiwi/cookiemonster/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/01b67bf5bc60a67df296/test_coverage)](https://codeclimate.com/github/qiwi/cookiemonster/test_coverage)
> Stateless fake API based on cookie processing

<img width="400" src="./src/docs/cookiemonster.svg">

## Usage
On server side:
```ts
//...
import {cookiemonster} from '@qiwi/cookiemonster'

const app = express()

app.use(cookieParser())
app.use(bodyParser.json())
app.use(cookiemonster())

app.listen(8080)
```

On client:

```ts
import {formatScenario} from '@qiwi/cookiemonster'

const data = formatScenario({
  steps: [
    {res: {code: 200, body: {foo: 'bar'}}}
  ]
})

document.cookie = `Cookiemonster=${data}`

const result = await fetch('http://localhost:8080', {credentials: 'include'})
const json = await result.json() // {foo: 'bar'}
```

## Refs
* [mock-server/mockserver](https://github.com/mock-server/mockserver)

## License
[MIT](./LICENSE)

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