nest-bcrypt
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

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

License

nest-bcrypt is MIT licensed.

/nest-bcrypt/

    Package Sidebar

    Install

    npm i nest-bcrypt

    Weekly Downloads

    6

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    14.1 kB

    Total Files

    13

    Last publish

    Collaborators

    • xavier577