@internetarchive/cookie-store
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-alpha.1 • Public • Published

cookie-store

Build Status npm version

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

Installation

npm install cookie-store

Basic Example

// import polyfill and declare types
import '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(obj); // [{ name: 'forgive', value: 'me' }, { name: 'forget', value: 'it' }]

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

Package Sidebar

Install

npm i @internetarchive/cookie-store

Weekly Downloads

1

Version

3.0.0-alpha.1

License

MIT

Unpacked Size

12.6 kB

Total Files

5

Last publish

Collaborators

  • jeffwklein
  • jim-at-ia
  • tracey.pooh
  • latonv
  • markcarranza
  • ibnesayeed
  • bfalling
  • mitraardron
  • vbanos
  • kngenie
  • iisa
  • cdrini
  • nsharma123
  • dualcnhq