Skip to content

Javascript library for handling localStorage, sessionStorage, and custom storage methods with a consistent, advanced, and flexible api.

Notifications You must be signed in to change notification settings

michaeldrotar/storage-js

Repository files navigation

storage-js

Build Status

Javascript library for handling localStorage, sessionStorage, and custom storage methods with a consistent, advanced, and flexible api. Comes predefined with support for local, session, and page-level storage. Great for working with nested objects. Allows storage of null, boolean, string, number, object, and array data.

var session = new Storage('session');
session.set('person.age', 20);
session.set('person.name', { 'first': 'John', 'last': 'Doe' });
session.set('person.name.middle', 'Paul');
session.get('person'); // Returns: { name: { first: 'John', last: 'Doe', middle: 'Paul' }, age: 20 }
var hobbies = new Storage('session', 'person.hobbies');
hobbies.set('Coding', true);
hobbies.set('Volleyball', true);
hobbies.set('Swimming', true);
session.get('person.hobbies'); // Returns: { Coding: true, Volleyball: true, Swimming: true }
session.get(['person', 'nothing']); // Returns undefined

About

Javascript library for handling localStorage, sessionStorage, and custom storage methods with a consistent, advanced, and flexible api.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published