@forge/cache
v0.12.1
Published
Forge Cache methods
Downloads
2,343
Keywords
Readme
Library for Forge environment.
Usage example:
import cache from "@forge/cache";
const cacheClient = cache.connect();
await cacheClient.set("hello", "3", { ttlSeconds: 30 });
const result = await cacheClient.setIfNotExists("hello", "3", { ttlSeconds: 30 });
const result = await cacheClient.get("hello");
const result = await cacheClient.getAndSet("hello", "3", { ttlSeconds: 30 });
const result = await cacheClient.incrementAndGet("hello");
const result = await cacheClient.decrementAndGet("hello");
const result = await cacheClient.delete("hello");
const result = await cacheClient.scan("hello*", { cursor: "10", count: 10 });
const result = await cacheClient.leftPush("list", "3");
const result = await cacheClient.rightPop("list");
const result = await cacheClient.listLength("list");