@segment/cookie
v1.2.0
Published
Tiny cookie component
Downloads
101,949
Maintainers
Keywords
Readme
cookie
Cookie component.
Installation
$ npm install @segment/cookie
Example
// set
cookie('name', 'tobi')
cookie('name', 'tobi', { path: '/' })
cookie('name', 'tobi', { maxage: 60000 }) // in milliseconds
cookie('species', 'ferret')
// get
var name = cookie('name')
// => "tobi"
var cookies = cookie()
// => { name: "tobi", species: "ferret" }
// clear
cookie('name', null)
License
Released under the MIT license.