0.2.2 • Published 8 years ago

ilocalstorage v0.2.2

Weekly downloads
2
License
BSD-3-Clause
Repository
github
Last release
8 years ago

iLocalStorage

NPM version Build Status Dependency Status

Provides an abstraction on top of the native localstorage implementations in the browsers. The goal is to handle the differences in implementations (which is really insignificant if existing at all) and especially the differences in error scenarios.

Installation

The package is available on npm.

$ npm install ilocalstorage

Enhanced feature set

Besides the normal localstorage feature set, an extended set i provided, that allows you to store any kind of data in localstorage, and not just strings.

With native localStorage this would be the result:

localStorage.setItem('foo', { bar: 'baz' });
localStorage.getItem('foo');
// => "[object Object]"

Transforming the input data to JSON before saving it, allows us to persist objects in localstorage.

var iStorage = new iLocalStorage();
iStorage.set('foo', { bar: 'baz' });
iStorage.get('foo');
// => { bar: 'baz'});

iLocalStorage.remove exists aswell, but it is just a mapping to the native remoteItem method.

0.2.2

8 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago