# @firstandthird/cookie-monster

> Cookie manager

Latest version **3.2.0** (published 2020-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @firstandthird/cookie-monster
pnpm add @firstandthird/cookie-monster
yarn add @firstandthird/cookie-monster
bun add @firstandthird/cookie-monster
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2020-04-27 |
| First published | 2017-01-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | First+Third |
| Maintainers | alaguna, aleperez92, dawnerd, ecwillis, jga, orthagonal1 |
| Keywords | browser, module, helper, cookies |

## Links

- npm: https://www.npmjs.com/package/@firstandthird/cookie-monster
- Repository: https://github.com/firstandthird/cookie-monster
- Homepage: https://github.com/firstandthird/cookie-monster#readme
- Issues: https://github.com/firstandthird/cookie-monster/issues
- npm.io page: https://npm.io/package/@firstandthird/cookie-monster

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 3.2.0 (latest) — 2020-04-27
- 3.1.0 — 2019-07-02
- 3.0.0 — 2019-04-12
- 2.0.0 — 2017-01-31

## README

# Cookie Monster

[![Build Status](https://travis-ci.org/firstandthird/cookie-monster.svg?branch=master)](https://travis-ci.org/firstandthird/cookie-monster)
![npm](https://img.shields.io/npm/v/@firstandthird/cookie-monster.svg)

Cookie manager

## Installation

```sh
npm install @firstandthird/cookie-monster
```

## Usage

```js
import CookieMonster from '@firstandthird/cookie-monster';

const name = 'cookiename'; // required
const value = 'somevalue'; // required - may also be an object
const expires = 10; // optional - Days cookie is valid
const path = '/test'; // optional - defaults to /
const domain = 'blog.example.com'; // optional
const isSecure = false; // optional - sets secure flag
const sameSite = 'Strict'; // optional - defaults to 'Strict' - Valid values: 'None', 'Lax', 'Strict'

// Set cookie
CookieMonster.set(name, value, expires, path, domain, isSecure, sameSite);

// Get cookie
CookieMonster.get(name);

// Remove cookie

CookieMonster.remove(name);

// Increment a counter cookie
CookieMonster.increment(name, expires);

// Decrement a counter cookie

CookieMonster.decrement(name, expires);
```

Methods can also be imported as needed:

```js
import { get, remove } from '@firstandthird/cookie-monster';

get(name);

remove(name);
```

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