Local Storage Database consistency with objects.
Simple class to store data and manage it easily.
Checkout example on codesandbox:
Import module:
import Collection from "../release/localDatabase";
Create the instance (or many):
let myCollection = new Collection("test");
Interact with it:
let myCollection = new Collection("test");
// set some data
myCollection.set({ test: 2323, gra: 23 });
// update it with new data
myCollection.set({ awesome: 2323 });
// get entire json db
console.log(myCollection.get());
// or single key
console.log(myCollection.get("test"));
// remove single key
console.log(myCollection.remove("gra"));
// remove entire db
console.log(myCollection.remove());