1.0.0 • Published 5 years ago
ciacho v1.0.0
ciacho.js
A lightweight library for removing, adding and setting cookies in browser.
Install
# Install with npm...
$ npm install --save ciacho
# ...or you can use yarn
$ yarn add ciacho
Usage
// Import the whole package...
import Ciacho from 'ciacho';
// or modules.
import setCookie from 'ciacho/src/setCookie';
import getCookie from 'ciacho/src/getCookie';
import removeCookie from 'ciacho/src/removeCookie';
Methods
// Set cookie
Ciacho.set('name', 'value', {
path: '/',
expires: 2 * 24 * 60 * 60 * 1000, // 2 days
});
// Get cookie
Ciacho.get('name');
// Remove cookie
Ciacho.remove('name', '/path');