abs-nestjs-password-service
v0.0.2
Published
`PasswordService` is a custom json service that can be used in a NestJS to stringify or parse a json data
Downloads
19
Readme
PasswordService Documentation
PasswordService
is a custom json service that can be used in a NestJS to stringify or parse a json data
Installation
To install the necessary dependencies, run:
npm install abs-nestjs-password-service
Usage with NestJS
- Import the PasswordService into your module:
import { Module } from '@nestjs/common';
import { PasswordService } from 'abs-nestjs-password-service';
@Module({
providers: [PasswordService],
exports: [PasswordService],
})
export class AppModule {}
- Inject the PasswordService into your service or controller:
import { Injectable } from '@nestjs/common';
import { PasswordService } from 'abs-nestjs-password-service';
@Injectable()
export class SomeService {
constructor(private readonly passwordServices: PasswordService) {}
someMethod() {
const hash = this.passwordService.hashPassword('password123');
console.log(hash);
console.log(this.passwordService.matchPassword('password123', hash));
}
}