cordova-plugin-oreo

0.3.2 • Public • Published

Oreo.js for Cordova

Add cookies to your Cordova Project.

npm version Cordova Ionic Ionic Ionic


Note: This plugin is an adapted version of the original oreo.js package.

Installation

Plugin Manager

cordova plugin add cordova-plugin-oreo

CDN (Recommended)

<script src="https://cdn.jsdelivr.net/npm/oreo.js/dist/oreo.min.js"></script>

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.

Package Sidebar

Install

npm i cordova-plugin-oreo

Weekly Downloads

1

Version

0.3.2

License

ISC

Unpacked Size

27.4 kB

Total Files

6

Last publish

Collaborators

  • diablorodriguez