DefinitelyTyped/types/node-redis-pubsub/node-redis-pubsub-tests.ts
2018-09-18 10:44:04 +02:00

20 lines
423 B
TypeScript

import NRP = require("node-redis-pubsub");
import { RedisClient } from "redis";
const options = {
port: 6379
};
const nrp: NRP.NodeRedisPubSub = NRP(options);
nrp.on("message:*", (data, channel) => {});
nrp.subscribe("message:*", (data, channel) => {});
const redis: RedisClient = nrp.getRedisClient();
nrp.emit("message:test", "hello world");
nrp.publish("message:test2", "hello world2");
nrp.quit();
nrp.end();