Need help with xStore?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

florian
238 Stars 38 Forks MIT License 110 Commits 0 Opened issues

Description

Client-side stores that serialize data for you

Services available

!
?

Need anything else?

Contributors list

# 117,733
CSS
HTML
Git
Shell
79 commits
# 5,799
JavaScr...
CSS
seleniu...
Firefox
2 commits
# 501,449
HTML
Shell
CSS
browser...
1 commit
# 710,959
JavaScr...
HTML
1 commit

xStore Build Status

xStore wraps the HTML5

localStorage
and
sessionStorage
APIs to provide client-side storage, mainly targeted at web apps. It allows you to create different data stores that serialize data for you.

In a nutshell:

  • It's small: 0.8 KB if minified+gzipped and it doesn't have dependencies
  • xStore serializes Booleans, numbers, strings, arrays and plain objects for you
  • Chaining support
  • It has a cookie.js like interface.
  • You can choose if your storage should be persistent (
    localStorage
    ) or just for a session (
    sessionStorage
    )

Some example code

var store = new xStore("prefix", localStorage);
store.set({
  list: [1, 2],
  counter: 1
});

// Later

store.push('list', 3, 4).increase('counter'); // Chaining is awesome

// And read the values:

store.get('list'); // [1, 2, 3, 4] store.get('counter'); 2

Another micro library for client-side storage?

Yep, there are already some similar libraries out there, but I decided to write my own one because none didn't really fit my needs. xStore only supports browers that are somewhat modern. Furthermore it has an interface that makes working with client-side storage a breeze.

Getting started

Read these wiki entries:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.