Pseudo DB

A very simple mock-database for learning and easy data persistence.

How to use:

1. Include the following script tags in your HTML:


<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://pseudo-db.herokuapp.com/js/pseudo-db.js"></script>
      
2. Choose a secret for your data. Must be text, without spaces, digits are okay.

3. Uploading Data - to upload data to the db, call upon the function pdb.upload(secret, data). Uploading data will overwrite any existing data. Example:

const data = {
  name: 'Tim',
  age: 26,
};

pdb.upload('supers3cre+w0w', data);
      
4. Downloading Data - to download the data from the db, call upon the function pdb.download(secret). This returns a promise, which you can then use .then() to handle the data once it comes back. Example:

pdb.download('supers3cre+w0w').then(data => {
  console.log(data);
});