0.1.3 • Published 10 years ago

simple-browser-storage v0.1.3

Weekly downloads
14
License
MIT
Repository
github
Last release
10 years ago

simpleStorage

Module gives you opportunity to store your simple JSON data in localStorage or Cookies (dependent on what is accessible for current browser)

Usage

To install with npm:

npm install --save simple-browser-storage

And then any where you want to use module:

var opts = {name: 'StorageName', expiresTime: 10}
var browserStorage = require('simple-browser-storage')(opts);

// In your Cookies (or localStorage) will be created an empty JSON object.
// You can communicate with it through following intreface:
browserStorage.setState(dataObject);
browserStorage.getState(); // Returns whole data object;
browserStorage.stateIsExpired(); // Returns whether expired or not dataObject;

Options

opts = {
  name: 'String', // Name of JSON object which will be created. Default: "SimpleBrowserStorage"
  expiresTime: 'Number' // Time in minutes after which data will be deleted on next browser refresh. Default: 10
}
0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago