1
2
3
4
5
6
7
8
9
10
11
import process from "node:process";
export const upstashJSONEx = (async () => {
const { Redis } = await import("npm:@upstash/redis");
const redis = new Redis({
url: process.env.upstashURL,
token: process.env.upstashToken,
});
await redis.set("json-ex-1", { a: { b: "nested json" } });
return ((await redis.get("json-ex-1")) as any).a.b;
})();