1.0.0 • Published 10 years ago

packagestore v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

PackageStore

A JavaScript library that allows for flexible storage of data in a secure manner. The interface to store variables is exactly the same as localStorage.

All variables are persisted in a single localStorage variable, which can be optionally encrypted with the algorithm of your choice.

Simple Example:

var packagestore = new PackageStore({
  'storageKey' : 'HighlyRecommendYouChangeThis'
});

packagestore.setItem('my_variable', 'Hello world!');
console.log(packagestore.getItem('my_variable'));

With Encryption:

var packagestore = new PackageStore({
  'storageKey' : 'HighlyRecommendYouChangeThis',
  'encrypt' : function(str) {
    return window.btoa(str);
  },
  'decrypt' : function(str) {
    return window.atob(str);
  }
});

packagestore.setItem('my_variable', 'Hello world!');
console.log(packagestore.getItem('my_variable'));

To run the tests:

Open the file tests/SpecRunner.html in your browser
1.0.0

10 years ago