# nestjs-cookie

> Read cookies using decorators in NestJS

Latest version **1.0.0** (published 2023-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install nestjs-cookie
pnpm add nestjs-cookie
yarn add nestjs-cookie
bun add nestjs-cookie
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-01-02 |
| First published | 2023-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tyler Stewart |
| Maintainers | trs |

## Links

- npm: https://www.npmjs.com/package/nestjs-cookie
- Repository: https://github.com/trs/nestjs-cookie
- npm.io page: https://npm.io/package/nestjs-cookie

## Dependencies (1)

- [cookie](https://npm.io/package/cookie.md) ~0.5.0

## Recent versions

- 1.0.0 (latest) — 2023-01-02

## README

# NestJS Cookie

> Initialize a new Typescript project for Node

## Install

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

## Usage

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

```ts
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

```ts
import { Cookies } from 'nestjs-cookie';

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

---
_Source: https://npm.io/package/nestjs-cookie · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
