npm install @aaron_kst/local-cache --save
const LocalCache = require("@aaron_kst/local-cache");
import LocalCache from "@aaron_kst/local-cache";
This will create a "/cache" directory within your project folder. Inside the directory will be a json file named according to your constructor argument.
const Cache = new LocalCache("Foo");
This method is used to save an item into your cache.
const foo = Cache.setItem("foo", "bar");
console.log(foo) // true;
This method is used retrieve an item saved into the local cache.
const foo = Cache.getItem("foo");
console.log(foo) // bar;