Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const redis = require('redis');
- const {promisify} = require('util');
- const client = redis.createClient();
- client.on("error",(err)=>{
- console.log(err);
- });
- client.on("ready",()=>{
- console.log("Redis connection esablished");
- });
- const redisClient = {
- SADD: promisify(client.SADD).bind(client),
- SIMEMBER: promisify(client.SISMEMBER).bind(client),
- SREM: promisify(client.SREM).bind(client),
- SET : promisify(client.SET).bind(client),
- GET: promisify(client.get).bind(client),
- HSET: promisify(client.HSET).bind(client),
- HGET: promisify(client.HGET).bind(client),
- DEL: promisify(client.DEL).bind(client),
- EXISTS: promisify(client.EXISTS).bind(client)
- }
- module.exports = redisClient;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement