jStorage from Andris Reinman is a small (2kb) simple wrapper for popular javascript frameworks to abstract local storage. HTML5 local storage is used if present and it even supports userData in older versions of IE.

compatibility chart

The simple API supports, get, set, delete and flush operations:

// set a value
$.jStorage.set(key, value)

// retrieve a value with a default if not set
value = $.jStorage.get(key, "default value")

// delete a key, throws exception if not set
$.jStorage.deleteKey(key)

// flush entire cache

$.jStorage.flush()

[Source on GitHub] [Homepage]


Have comments? Send a tweet to @TheChangelog on Twitter.

Subscribe to The Changelog Weekly – our weekly email covering everything that hits our open source radar.