Quartz Storage
Quartz Storage is meant to be a simple and safe cross browser/platform storage for games. It makes use of localStorage when possible and falls back to cookies when localStorage is not accesible.
Storage can be namespaced so you can use same key values amonst different games/pages on the same site
Getting Started
First you'd want to include the library in your page by doing the following:
Setup a namespace
The storage objects in Quartz Storage are by default all grouped in a Quartz: namespace. If you would like a different (game specific) namespace, you can just get an instance and set the namespace.
QuartzStorage ;
Set/Get an item
Setting and getting of items is as straightforward as ever:
QuartzStorage ; //bar
Keep in mind that due to localStorage all keys and values should be string!
var s = QuartzStorage; s; var num = s; s === 162; //false === 162; //true
Changelog
2.0.2
- Fixed an issue with the CookieStorage where values would have ';' appended to them
2.0.1
- Added noImplicitAny
- package rename to match npm's requirements