Skip to content

palmerj3/PackageStore

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

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

About

A JavaScript library that allows for flexible storage of data in a secure manner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published