# mockoa

> Simple data generator using Mockaroo API

Latest version **0.0.1** (published 2021-03-24) · ISC license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-03-24 |
| First published | 2021-03-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | achtouf |
| Maintainers | achtouf |

## Links

- npm: https://www.npmjs.com/package/mockoa
- Repository: https://github.com/Achtouf/Mockoa
- Homepage: https://github.com/Achtouf/Mockoa#readme
- Issues: https://github.com/Achtouf/Mockoa/issues
- npm.io page: https://npm.io/package/mockoa

## Recent versions

- 0.0.1 (latest) — 2021-03-24

## README

# mockoa

## Features
- Get Mockaroo Types list
- Generate data from mockaroo valid schema in different formats (json, csv, txt)

## Installing
Using npm:

```bash
$ npm install mockoa
```

Using yarn:

```bash
$ yarn add mockoa
```

## Exemple
```javascript
const fs = require("fs");
const Mockoa = require("mockoa").default;

const instance = new Mockoa("[key]");
const ProductSchema = [
    {
        "name": "id",
        "type": "Row Number",
    },
    {
        "name": "name",
        "type": "Product (Grocery)",
    },
    {
        "name": "quantity",
        "type": "Number",
        "min": 1,
        "max": 20,
        "decimals": 0,
    },
];

const getProducts = async (count, format = "json") => {
  await instance
    .generate(ProductSchema, count, format)
    .then((data) => {
      console.debug("data: ", data);
    });
};

getProducts(3);
```
```bash
# output:
data: [
  { id: 1, name: 'Carbonated Water - Peach', quantity: 18 },
  { id: 2, name: 'Bowl 12 Oz - Showcase 92012', quantity: 14 },
  { id: 3, name: 'Halibut - Steaks', quantity: 20 }
]
```

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