nestjs-uuid
v0.1.4
Published
A NestJS module for generating UUIDs
Downloads
2,697
Maintainers
Readme
nestjs-uuid
Installation
yarn add nestjs-uuid
npm i nestjs-uuid
How to use
Import module:
@Module({
imports: [
UuidModule
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
Inject uuid service into a provider:
v0.0.5
@Injectable()
export class AppService {
constructor(@InjectUuidService() private readonly uuidService: UuidService) {}
getHello() {
return this.uuidService.generate();
}
}
After v.0.0.5
@Injectable()
export class AppService {
constructor(private readonly uuidService: UuidService) {}
getHello() {
return this.uuidService.generate();
}
}
getHello() {
return this.uuidService.generate({ version: 1 });
}
getHello() {
return this.uuidService.generate({ version: 4 });
}