New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

i-cookie

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i-cookie

A simple, lightweight JavaScript API for handling browser cookies

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
9
50%
Maintainers
1
Weekly downloads
 
Created
Source

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'

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
iCookie.cookie("CookieKey")
iCookie.deleteCookie("CookieKey")

Authors

Hancoson

MIT

Keywords

json

FAQs

Package last updated on 11 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts