1.0.1 • Published 3 years ago

@thunder_fury/operate-cookie v1.0.1

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

@thunder_fury/operate-cookie

A simple library for adding, removing and retrieving browser cookies

install

  $ npm i -D @thunder_fury/operate-cookie
  $ npm i @thunder_fury/operate-cookie

import

const { OperateCookie } = require('@thunder_fury/operate-cookie');
//OR
import { OperateCookie } from '@thunder_fury/operate-cookie';

Method

MethodDescription
addAdd cookie
getGet cookie
addParmsAdd parameter cookie
removeremove cookie

Example of use

const operateCookie = new OperateCookie

set cookie

  operateCookie.add(key, value, maxAge)

Set the method arguments in the order of key, value, maxAge.


get cookie

  operateCookie.get(key)

Set the key of the cookie you want to get in the parameter of method as a character string


remove cookie

  operateCookie.remove(key)

Pass the cookie you want to get as a string in the argument of method


set parms cookie

  operateCookie.addParms()

For example, if you set the key=value parameter to a URL like this, you can just call the method and the value will be stored in the key in the browser cookie.

1.0.1

3 years ago

1.0.0

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago