@allex/cookie
v1.0.9
Published
A cookie maintaining for document.cookie get/set
Downloads
5
Readme
Cookie
A cookie maintaining for document.cookie get/set.
Make document.cookie r/w more simple and readable.
Author: Allex Wang ([email protected])
Installation
npm i @allex/cookie
Usage
import cookie from '@allex/cookie'
cookie.set('foo', 'foo_value')
cookie.set('foo2', 'foo_value2', {expires: 7}) // expires 7 days
let value = cookie.get('foo')
console.log(value) // foo
cookie.set('foo', null) // clear cookie
console.log(cookie.get('foo')) // null
License
MIT