Skip to content

shyrz/donut.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

donut.js

Another local-storage solution.

🍩 🍩 🍩 => oOo

Usage

Browser

<script type="text/javascript" src="path/to/donut.js"></script>
<script type="text/javascript">
  // ...Code here whatever you like
</script>

Node

var oOo = require('donut.js');
// ...Code here whatever you like

API

oOo.cookie [ or donut.cookie ]

get(key)

oOo.cookie.get('key'); // { String } Cookie key name

getAll()

oOo.cookie.getAll();

set(key, value, options)

oOo.cookie.set('key', 'value', { // { String } Cookie key name and value
  expires:  1,                   // { Number } Expires hours
  domain:   'example.com',       // { String } Domain
  path:     '/path/to/...',      // { String } Path
  secure:   false,               // { Boolean } Secure
  httpOnly: false                // { Boolean } HttpOnly
});

remove(key)

oOo.cookie.remove('key'); // { String } Cookie key name

removeAll()

oOo.cookie.removeAll();

License

donut.js © Phantr4x, Released under the MIT License.

Authored and maintained by Phantr4x

Releases

No releases published

Packages

No packages published