# nestjs-uuid

> A NestJS module for generating UUIDs

Latest version **0.1.4** (published 2024-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install nestjs-uuid
pnpm add nestjs-uuid
yarn add nestjs-uuid
bun add nestjs-uuid
```

## 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.1.4 |
| Published | 2024-02-17 |
| First published | 2023-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 14 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Fernando Dorantes |
| Maintainers | fdorantesm |
| Keywords | nest, nestjs, uuid, uuidv1, uuidv4 |

## Links

- npm: https://www.npmjs.com/package/nestjs-uuid
- Repository: https://github.com/NestJS-Libs/nestjs-uuid
- Homepage: https://github.com/NestJS-Libs/nestjs-uuid#readme
- Issues: https://github.com/NestJS-Libs/nestjs-uuid/issues
- npm.io page: https://npm.io/package/nestjs-uuid

## Dependencies (5)

- [rxjs](https://npm.io/package/rxjs.md) ^7.8.1
- [uuid](https://npm.io/package/uuid.md) ^9.0.1
- [@nestjs/core](https://npm.io/package/@nestjs/core.md) ^10.0.0
- [@nestjs/common](https://npm.io/package/@nestjs/common.md) ^10.0.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13

## 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

- 0.1.4 (latest) — 2024-02-17
- 0.1.3 — 2024-02-17
- 0.1.2 — 2024-02-17
- 0.1.1 — 2024-02-17
- 0.1.0 — 2024-02-17
- 0.0.61--dev — 2024-02-17
- 0.0.6--dev — 2024-02-17
- 0.0.6 — 2023-10-12
- 0.0.5 — 2023-10-12
- 0.0.4 — 2023-10-12
- 0.0.3 — 2023-10-12
- 0.0.2 — 2023-10-12
- 0.0.1 — 2023-06-08

## README

# nestjs-uuid

## Installation

```bash
yarn add nestjs-uuid
```

```bash
npm i nestjs-uuid
```

---

<br>

## How to use

<br>

Import module:

```ts
@Module({
  imports: [
    UuidModule
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
```

---

<br>

Inject uuid service into a provider:

v0.0.5

```ts
@Injectable()
export class AppService {
  constructor(@InjectUuidService() private readonly uuidService: UuidService) {}

  getHello() {
    return this.uuidService.generate();
  }
}
```

After v.0.0.5

```ts
@Injectable()
export class AppService {
  constructor(private readonly uuidService: UuidService) {}

  getHello() {
    return this.uuidService.generate();
  }
}
```

```ts
  getHello() {
    return this.uuidService.generate({ version: 1 });
  }
```

```ts
  getHello() {
    return this.uuidService.generate({ version: 4 });
  }
```

---

<div align="center">
    <a href="https://github.com/fdorantesm" target="_blank">
        <img src=https://img.shields.io/badge/github-%2324292e.svg?&style=for-the-badge&logo=github&logoColor=white alt=github style="margin-bottom: 5px;" />
    </a>
    <a href="https://twitter.com/fdorantesm" target="_blank">
        <img src=https://img.shields.io/badge/twitter-%2300acee.svg?&style=for-the-badge&logo=twitter&logoColor=white alt=twitter style="margin-bottom: 5px;" />
    </a>
    <a href="https://linkedin.com/in/fdorantesm" target="_blank">
        <img src=https://img.shields.io/badge/linkedin-%231E77B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white alt=linkedin style="margin-bottom: 5px;" />
    </a>
    <a href="https://www.youtube.com/user/FernandoDorantes" target="_blank">
        <img src=https://img.shields.io/badge/youtube-%23EE4831.svg?&style=for-the-badge&logo=youtube&logoColor=white alt=youtube style="margin-bottom: 5px;" />
    </a>
    <a href="https://stackoverflow.com/users/6484286" target="_blank">
        <img src=https://img.shields.io/badge/stackoverflow-%23F28032.svg?&style=for-the-badge&logo=stackoverflow&logoColor=white alt=stackoverflow style="margin-bottom: 5px;" />
    </a>
    <a href="https://codepen.com/fdorantesm" target="_blank">
        <img src=https://img.shields.io/badge/codepen-%23131417.svg?&style=for-the-badge&logo=codepen&logoColor=white alt=codepen style="margin-bottom: 5px;" />
    </a>
</div>

<br/>  

<div align="center">
    <a href="https://paypal.me/fdorantesm" target="_blank" style="display: inline-block;">
        <img src="https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square&logo=paypal" align="center" />
    </a>
</div>

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