0.0.2 • Published 9 years ago
uupaa.cookie.js v0.0.2
Cookie.js
Cookie parse and build.
This module made of WebModule.
Documentation
Browser, NW.js and Electron
<script src="<module-dir>/lib/WebModule.js"></script>
<script src="<module-dir>/lib/Cookie.js"></script>
<script>
if (Cookie.ready) {
var obj = Cookie.parse("lang=ja;id=123");
obj.lang // -> "ja"
obj.id // -> 123
document.cookie = Cookie.build({ lang: ja }, { secure: true });
}
</script>
WebWorkers
importScripts("<module-dir>/lib/WebModule.js");
importScripts("<module-dir>/lib/Cookie.js");
Node.js
require("<module-dir>/lib/WebModule.js");
require("<module-dir>/lib/Cookie.js");