@algoan/nestjs-custom-decorators
TypeScript icon, indicating that this package has built-in type declarations

1.3.13 • Public • Published

Nestjs-custom-decorators

A set of nestjs custom decorators.

Installation

npm install --save @algoan/nestjs-custom-decoratos

User decorator

A param decorator that fetches the request.user (could be added by a middleware or a guard) and add it to the params.

Usage:

 @Get('/user')
 public getUser(@User() user: any): void {
   return user;
 }

DecodeJWT

A param decorator that decodes the JSON web token added to the request by a middleware or a guard and add it to the params.

Usage:

 @Get('/decode-jwt')
 public getDecodedJWT(@DecodeJWT() decodedJwt: any): void {
   return decodedJwt;
 }

Readme

Keywords

Package Sidebar

Install

npm i @algoan/nestjs-custom-decorators

Weekly Downloads

46

Version

1.3.13

License

ISC

Unpacked Size

4.6 kB

Total Files

8

Last publish

Collaborators

  • algoanbot
  • fabong