Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

GetStarted

201flaviosilva edited this page Jun 28, 2022 · 1 revision

Get Started

A simple example of how to use Guardar.

Instal

npm install guardar

Simple Usage

import Guardar from "guardar";
const { LocalInstance as Local, getVersion } = Guardar;

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("myData"));
Clone this wiki locally