Learn how companies like Phone2Action are using npm in their front-end developmentJoin the conversation »

cooki3js

1.0.0 • Public • Published

Cooki3JS

Github

Cooki3JS is an npm package for making browser cookies easier to read, make, and use.

Usage

Getting Started

Okay so you wanna get started! So there are some easy steps to get started. First you should require the package;

const cookie = reqiure("Cooki3JS");

Then, you are free to use any of our variables! For example:

const cookie = reqiure("Cooki3JS");
 
cookie.set(name, value, expiration in (days));
cookie.set('username', 'Cooki3', 30)

This will make a cookie called 'username' that contains 'Cooki3' that expires in 30 days.

All Variables

cookie.set(name, value, days cookie will last);: This is how you make a cookie.

cookie.read(name): This will show the cookie, not in string form.

cookie.string(name): This will show the cookie, in string form.

cookie.add(name, amount to add): This can add (amount) to a cookie if the cookie is a number a number.

cookie.sub(name, amount to subtract): This can subtract (amount) from a cookie if the cookie is a number.

cookie.mul(name, amount to multiply cookie by): This can multply a cookie if the cookie is a number.

cookie.div(name, amount to divide cookie by): This can divide a cookie if the cookie is a number.

Keywords

none

Install

npm i cooki3js

DownloadsWeekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.06 kB

Total Files

3

Last publish

Collaborators

  • avatar