1.1.1 • Published 6 years ago

i-cookie v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

i-cookie

GitHub license Travis npm version npm

A simple, lightweight JavaScript API for handling browser cookies

Getting started

run npm:

npm i i-cookie --save

and then:

import iCookie from 'i-cookie'

Write a cookie

A cookie is set with a simple object as the first parameter:

/**
* @param {key}
* @param {value}
* @param {option} set the `expires` 【non-mandatory】
*/
iCookie.cookie("CookieKey", CookieValue, {expires: Date});

The set Date demo:

var curDate = new Date();
curDate.setTime(curDate.getTime() + (1 * 60 * 1000)); //set 1 minute expire

Read a cookie

iCookie.cookie("CookieKey")

Delete a cookie

iCookie.deleteCookie("CookieKey")

Authors

Hancoson

MIT

1.1.1

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago