Skip to content

Aaronkst/local-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local Cache

Installation

npm install @aaron_kst/local-cache --save

Initialization

Common JS

const LocalCache = require("@aaron_kst/local-cache");

Module JS

import LocalCache from "@aaron_kst/local-cache";

Setup & Configuration

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");

Methods

Set Item

This method is used to save an item into your cache.

const foo = Cache.setItem("foo", "bar");
console.log(foo) // true;

Get Item

This method is used retrieve an item saved into the local cache.

const foo = Cache.getItem("foo");
console.log(foo) // bar;

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published