# responserun-mock

> ## Overview

Latest version **2024.2905.0** (published 2024-05-29) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2024.2905.0 |
| Published | 2024-05-29 |
| First published | 2023-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 54.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | responserun |
| Maintainers | responserun |

## Links

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

## Recent versions

- 2024.2905.0 (latest) — 2024-05-29
- 2023.11.2-1.0 — 2023-11-21
- 2023.11.1-3.3 — 2023-11-14
- 2023.11.1-3.2 — 2023-11-14
- 2023.11.1-3.1 — 2023-11-14
- 2023.11.1-3.0 — 2023-11-14
- 2023.11.1-2.2 — 2023-11-12
- 2023.11.1-2.1 — 2023-11-12
- 2023.11.1-2.0 — 2023-11-12
- 2023.11.1-1.2 — 2023-11-11
- 2023.11.1-1.1 — 2023-11-11
- 2023.11.1-1.0 — 2023-11-11
- 1.0.0 — 2023-11-11

## README

# responserun-mock

## Overview

`responserun-mock` is a simple TypeScript library that allows developers to generate names. surname , etc. It provides functions for creating random mock data 


## Installation
```
npm install --save-dev responserun-mock
```

## example

```javascript
const { createMaleFirstName, Locale, multipleRandomizer } = require('responserun-mock');


const turkishMaleName = createMaleFirstName(Locale.tr);

// multiple create object
const random = multipleRandomizer(
  () => ({
    name: createMaleFirstName(Locale.tr),
  }),
    5
  );

console.log(`Random Turkish Male Name: ${turkishMaleName}`);
console.log(random);
```

### jsx example
```javascript
import { useEffect, useState } from "react";
import {
  Locale,
  createAddress,
  createFemaleFirstName,
  createSurname,
  generateUuid4,
  multipleRandomizer,
} from "responserun-mock";

type User = {
  id: string;
  name: string;
  surname: string;
  address: string;
}

const TestPage = () => {
  const [users, setUsers] = useState<User[]>([]);

  useEffect(() => {
    const userList = multipleRandomizer(
      () => ({
        id: generateUuid4(),
        name: createFemaleFirstName(Locale.tr),
        surname: createSurname(Locale.tr),
        address: createAddress(Locale.tr),
      }),
      5
    );
    setUsers(userList);
  }, []);

  return (
    <div className="p-2">
      <ul>
        {users.map((user) => {
          return (
            <li key={user.id}>
              {user.name} {user.surname}
            </li>
          );
        })}
      </ul>
    </div>
  );
};

export default TestPage;
```

## Wiki

For more information, please check our [Wiki page](https://github.com/responserun/responserun-mock/wiki).


## Tests

The project includes a suite of tests. To ensure they run successfully, use the following command:

```bash
npm test
```

Additionally, to check code coverage, you can use the following command:

```bash
npm run coverage
```

This command generates a coverage report indicating how much of the code is covered by the tests. You can access the detailed report [here](https://responserun.github.io/responserun-mock/)



## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

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