Guardar
Table of Contents
Description
A simple lib to work and organize the localstorage.
Simple Example
Please check the wiki and the API to see how to use this lib.
Instal
npm install guardar
Simple Usage
import Guardar from "guardar"; // import Guardar to the project
const { LocalInstance as Local, getVersion } = Guardar; // set the LocalInstance as Local and get the version of the library
console.log(getVersion()); // "2.0.0"
const myData = {
myString: "Hello World",
myNumber: 123,
myBoolean: true,
myArray: [1, false, "Beep"],
myObject: {
name: "Dog",
age: 3,
isHappy: true,
breed: "Dachshund",
}
}
// Save the data
Local.setData("myData", myData);
// Get you data
console.log(Local.getData("myData"));
console.log(Local.getAll());