npm

nestjs-cookie
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

NestJS Cookie

Initialize a new Typescript project for Node

Install

npm install nestjs-cookie
# or
yarn add nestjs-cookie

Usage

Use the @Cookie decorator to grab a cookie from the cookie header.

import { Cookie } from 'nestjs-cookie';

@Get()
async myMethod(@Cookie('some_token') token: string) {
  console.log(token);
}

You can also grab a Map of all cookies using the @Cookies decorator

import { Cookies } from 'nestjs-cookie';

@Get()
async myMethod(@Cookies() cookies: Map<string, string>) {
  console.log(cookies);
}

Readme

Keywords

none

Package Sidebar

Install

npm i nestjs-cookie

Weekly Downloads

43

Version

1.0.0

License

MIT

Unpacked Size

8.22 kB

Total Files

21

Last publish

Collaborators

  • trs