Creates a new Redis client
constructor
RedisClient.constructor
@param url
URL to connect to, defaults to process.env.VALKEY_URL
, process.env.REDIS_URL
, or "valkey://localhost:6379"
@param options
Additional options
const redis = new RedisClient();
await redis.set("hello", "world");
console.log(await redis.get("hello"));
Referenced types
interface RedisOptions
namespace RedisClient
- type KeyLike = string | ArrayBufferView | Blob
- type StringPubSubListener = (message: string, channel: string) => void