asd-cookie
v1.0.1
Published
A cookie maintaining for document.cookie get/set
Downloads
4
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 asd-cookie
Usage
import cookie from 'asd-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