nest-bcrypt
v0.0.4
Published
A bcrypt module build for nestjs
Downloads
3
Maintainers
Readme
Description
Bcrypt Module for Nest.
Installation
$ npm install nest-bcrypt
Usage
Injecting the BcryptModule
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { BcryptModule } from 'nest-bcrypt';
@Module({
imports: [BcryptModule.register({ salt: 10 })],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
Using the BcryptService
import { Injectable } from '@nestjs/common';
import { BcryptService } from 'nest-bcrypt';
@Injectable()
export class AppService {
constructor(private readonly bcryptService: BcryptService) {}
public async hashData(data: string) {
return this.bcryptService.hash(data, 10);
}
}
Stay in touch
- Author - Joseph Tsegen
- Twitter - @Tsegs_tech
License
nest-bcrypt is MIT licensed.