@tomsd/redis-client
v1.1.1
Published
It's a wrapper of ioredis.
Downloads
315
Readme
@tomsd/redis-client
It's a wrapper of ioredis.
See redis-client.netlify.app also.
Installation
npm install @tomsd/redis-client
Usage
import { Redis } from "@tomsd/redis-client";
interface Some {
key: string;
name: string;
message: string;
}
const redis = new Redis<Some>({
keyProp: "key",
options: {
port: 6379,
host: "somehost",
}
});
console.log(
await redis.set({
key: "key",
name: "name",
message: "message",
})
) // { key: "key", name: "name", message: "message" }
console.og(
await redis.getKeys()
) // ["key"]
console.log(
await redis.get("key")
) // { key: "key", name: "name", message: "message" }
console.log(
await redis.del("key")
) // 1