Skip to content

markcellus/cookie-store

next
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Bumps [minimatch](https://github.com/isaacs/minimatch) to 3.1.2 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together.


Updates `minimatch` from 3.0.4 to 3.1.2
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v3.0.4...v3.1.2)

Updates `mocha` from 8.2.1 to 10.1.0
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](mochajs/mocha@v8.2.1...v10.1.0)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: mocha
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
16f146b

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

cookie-store

Build Status npm version

A ponyfill to allow use of the Cookie Store API in modern browsers that don't support it natively, including IE11. Also compatible with TypeScript.

⚠️ EXPERIMENTAL: The Cookie Store API is not a W3C standard yet and the final implementation may differ from the current API of this project.

Installation

To ensure the most up-to-date compatibility with browsers, we recommend that you install version 4 of the package with the next flag:

npm install cookie-store@next

Basic Example

// import polyfill and declare types
import { cookieStore } from 'cookie-store';

// set a cookie
await cookieStore.set('forgive', 'me');
// get a cookie
const foo = await cookieStore.get('forgive');
console.log(foo); // { name: 'forgive', value: 'me' }

// set another cookie
await cookieStore.set('forget', 'it');

// get multiple cookies
const cookies = await cookieStore.getAll();
console.log(cookies); // [{ name: 'forgive', value: 'me' }, { name: 'forget', value: 'it' }]

// delete a cookie
await cookieStore.delete('forget');

Development

Tests

Before running tests, you'll need to add the following entry to your /etc/hosts file on your machine:

127.0.0.1    foo.bar.localhost

Then run npm test