1.0.0 • Published 3 years ago
nestjs-cookie v1.0.0
NestJS Cookie
Initialize a new Typescript project for Node
Install
npm install nestjs-cookie
# or
yarn add nestjs-cookieUsage
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);
}1.0.0
3 years ago