MinCookie.js
A simple, lightweight JavaScript package for handling cookies
$ npm install @haikel/min-cookie --save
Usage
import mcookie from '@haikel/min-cookie';
or
let mcookie = require('@haikel/min-cookie');
Or include it via jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/@haikel/min-cookie@1.1.2/index.min.js"></script>
Methods
mcookie.set(cookieName, exdays, path, cookieData) : boolean
mcookie.get(cookieName) : array
mcookie.check(cookieName) : boolean
mcookie.remove(cookieName) : boolean
Examples
import mcookie from '@haikel/min-cookie';
const myData = [
"https://my test.com", "helloworld.com/", "?name=ståle", "&car=saa"
];
mcookie.set("mycookie" , 1, "/", myData);
mcookie.check("mycookie");
mcookie.get("mycookie");
mcookie.remove("mycookie");
License
MIT