1.1.3 • Published 4 years ago
hideko-caching v1.1.3
hideko-cache
Cache library used by Hideko discord bot
Installation
$ npm install hideko-cache
Usage
const HidekoCache = require("hideko-cache");
const cache = new HidekoCache(60); // in seconds
const obj = "object"; // string, number, boolean, object, array
cache.set(obj, "cache-key"); // set the cache
cache.remove("cache-key"); // remove from the cache
// cache that exists
cache.get("cache-key"); // return obj
// cache that doesn't exists
cache.get("cache"); // return undefined