Skip to content

A wrapper for localStorage, which will use chrome.storage if used in a chrome packaged app.

Notifications You must be signed in to change notification settings

SilentCicero/LocalStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

LocalStore

A wrapper for localStorage, which will use chrome.storage if used in a chrome packaged app.

Installation

Meteor.js

$ meteor add frozeman:storage    

Node.js

$ npm install localstorejs

Description

This is a reactive wrapper for localstorage, which will use chrome.storage.local if its used in a chrome packaged app.

If using Node:

var LocalStore = require('localstorejs');

To set an item just use:

LocalStore.set('myKey', {my: 'Object'});

// or

LocalStore.set('myKey', 'myString');

To get:

var value = LocalStore.get('myKey');

Additionally you can prevent reactive behavior, by passing {reactive: false}:

LocalStore.set('myKey', 'myString', {reactive: false});

When getting:

var value = LocalStore.get('myKey', {reactive: false});

As last parameter, you can also run a callback after the data was set, or get

LocalStore.set('myKey', {my: 'Object'}, false, function(){
	// do x	
});

Authors

Fabian Vogelsteller (Ethereum Dev) fabian.vogelsteller@gmail.com

NPM Mods by: Nick Dodson thenickdodson@gmail.com

About

A wrapper for localStorage, which will use chrome.storage if used in a chrome packaged app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published