0.3.32 • Published 3 years ago

oreo.js v0.3.32

Weekly downloads
18
License
ISC
Repository
github
Last release
3 years ago

Oreo.js

Add cookies to multiple platforms with Cordova, Electron and Browsers.

npm version Electron Cordova Browsers Backend Server Support


Installation

Node.js (Electron/Backend-Servers)

npm i oreo.js --save

Browser CDN

https://cdn.jsdelivr.net/npm/oreo.js/dist/oreo.min.js

Cordova

cordova plugin add cordova-plugin-oreo

Self-Host / Download

Go to dist folder, download one of the javascript files and save it in your project folder then just import it via html: <script src="./oreo.min.js"></script> or node.js: require( './oreo.js' )

Examples

// WRITE A COOKIE [v]
// WILL EXPIRE IN A MONTH BY DEFAULT [v]
oreo( 'my-cookie-key', 'my-cookie-value' ) ;

// WRITE A COOKIE WITH EXPIRATION-DATE AND PATH [v]
// WILL EXPIRE IN A YEAR [v]
expiration = new Date( ) ;
expiration = expiration.setFullYear( expiration.getFullYear( ) + 1 ) ;
// OR 
expiration = 365 ; // EXPIRATION IN DAYS IS ACCEPTABLE TOO.
oreo( 'my-cookie-key', 'my-cookie-value', { expires : expiration, path : '/blog/' } ) ;

// READ COOKIE [v]
var cookie = oreo( 'my-cookie-key' ) ;

// REMOVE COOKIE [v]
oreo.remove( 'my-cookie-key' ) ;

// CLEAR ALL [v]
oreo.clear( ) ;

As programmer, I prefer to look at examples to understand how a package works. So I make a few examples with comments in the examples folder.


Documentation

Check the updated documentation page to see all available Methods, Properties and Events of oreo.js

Also the docs page have useful information such as devlog, tips, storage-info and other stuff, so check it out.

Bugs & Requests

You can go to the issues section to report bugs and request new features.

Support

Support this project and game-development assets through Patreon or Itch.io

0.3.32

3 years ago

0.2.47

3 years ago

0.2.46

3 years ago

0.2.45

3 years ago

0.2.44

3 years ago

0.2.43

3 years ago

0.2.42

3 years ago

0.2.41

3 years ago

0.2.4

3 years ago