@tomsd/redis-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@tomsd/redis-client

It's a wrapper of ioredis.
See redis-client.netlify.app also.

Installation

npm install @tomsd/redis-client

Usage

importing Redis class.

import { Redis } from "@tomsd/redis-client";

creating an instance.

interface Some {
  key: string;
  name: string;
  message: string;
}

const redis = new Redis<Some>({
  keyProp: "key",
  options: {
    port: 6379,
    host: "somehost",
  }
});

setting data.

console.log(
  await redis.set({
    key: "key",
    name: "name",
    message: "message",
  })
) // { key: "key", name: "name", message: "message" }

getting keys.

console.og(
  await redis.getKeys()
) // ["key"]

getting data.

console.log(
  await redis.get("key")
) // { key: "key", name: "name", message: "message" }

deleting data.

console.log(
  await redis.del("key")
) // 1

Readme

Keywords

Package Sidebar

Install

npm i @tomsd/redis-client

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

9.99 kB

Total Files

5

Last publish

Collaborators

  • tomsd