# @ethico/fakeuuid

> FakeUUID is a lightweight package for generating random UUIDs (Universal Unique Identifiers) with customizable options.

Latest version **1.0.2** (published 2023-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ethico/fakeuuid
pnpm add @ethico/fakeuuid
yarn add @ethico/fakeuuid
bun add @ethico/fakeuuid
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-10-17 |
| First published | 2023-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Shariar Hasan |
| Maintainers | ethico |
| Keywords | uuid, unique id |

## Links

- npm: https://www.npmjs.com/package/@ethico/fakeuuid
- Repository: https://github.com/Shariar-Hasan/FakeUUID
- Homepage: https://github.com/Shariar-Hasan/FakeUUID#readme
- Issues: https://github.com/Shariar-Hasan/FakeUUID/issues
- npm.io page: https://npm.io/package/@ethico/fakeuuid

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-10-17
- 1.0.1 — 2023-05-13
- 1.0.0 — 2023-04-20

## README

# FakeUUID

`FakeUUID` is a lightweight package for generating random UUIDs (Universal Unique Identifiers) with customizable options. Each time it creates totally unique id/ key.

## Installation

To use FakeUUID, simply download the code from this repository and include it in your project.
You can install the package using npm:

```
npm install @ethico/fakeuuid
```

Alternatively, you can download the `FakeUUID.js` file and include it in your project manually.
or You can use the CDN for it

```html
<script src="https://cdn.jsdelivr.net/gh/Shariar-Hasan/FakeUUID/src/FakeUUID.min.js"></script>
```

for importing :

```javascript
import FakeUUID from "@ethico/fakeuuid";
```

## Usage

```javascript
const uuid = FakeUUID({
  startsWith: "user_",
  endsWith: "_id",
  length: 12,
  digit: true,
  lowerAlphabets: true,
  upperAlphabets: false,
  specialChars: "",
});
console.log(uuid); // Output: user_hivzjxod_id
```

## Options

| Option           | Description                                                        | Default value | Required |
| ---------------- | ------------------------------------------------------------------ | ------------- | ------------- |
| `startsWith`     | A string with which the UUID should start.                         | `""`          | optional |
| `endsWith`       | A string with which the UUID should end.                           | `""`          | optional |
| `length`         | The total length of the UUID.(excluding startsWith & endsWith)                                      | `32`          | optional |
| `digit`          | Whether to include digits in the UUID.                             | `true`        | optional |
| `lowerAlphabets` | Whether to include lowercase letters in the UUID.                  | `true`        | optional |
| `upperAlphabets` | Whether to include uppercase letters in the UUID.                  | `false`       | optional |
| `specialChars`   | A string containing special characters to be included in the UUID. | `""`          | optional |

You can use zero or more of the following options.

```javascript
//          Example 
console.log(FakeUUID());
// ab3egdhs8f88safafssdjnbchfbdnsbb

console.log(FakeUUID({ length: 8, digit: true }));
// ab3e8f88

console.log(FakeUUID({ length: 8, upperAlphabets: true }));
// aB3e8F88

console.log(
  FakeUUID({ length: 8, upperAlphabets: true, lowerAlphabets: false })
);
// AB3E8F88

console.log(
  FakeUUID({
    startsWith: "$uid_",
    endsWith: "",
    length: 12,
    digit: true,
    lowerAlphabets: true,
    upperAlphabets: true,
    specialChars: "-",
  })
);
// $uid_dH3-Udh4
```

## License

This project is licensed under the terms of the MIT license. See LICENSE file for details.

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