single-cookies
v1.0.0
Published
----- Reasons for choosing single merge ----- 1. single-xxx series plugin each plugin does only one thing 2. the plugin size is less than 1k 3. Provides a complete set of methods for editing cookies 4. High configuration policy
Downloads
1
Readme
single-cookies
description
----- Reasons for choosing single merge -----
- single-xxx series plugin each plugin does only one thing
- the plugin size is less than 1k
- Provides a complete set of methods for editing cookies
- High configuration policy
methods
- getCookie -- The method to obtain the cookie according to the key
- input parameter: key: string -- cookies key
- deleteCookie -- Delete the specified cookie according to the key
- input parameter: key: string -- cookies key
- clearCookie -- delete all cookies
- editCookie -- Method of editing cookie
- input parameter: key: string -- cookies key
- input parameter: value: string -- cookies value
- According to the key, you can modify it directly if it exists; otherwise, you can add it directly
example for
example1:
const {getCookie} = require('single-cookies')
const value = getCookie('name')
example2:
const {deleteCookie} = require('single-cookies')
deleteCookie('name')
example3:
const {editCookie} = require('single-cookies')
editCookie('name', 'lihh')
install
npm install single-cookies --save
yarn add single-cookies --save