const redis = require('redis');
const { promisify } = require('util');
const client = redis.createClient();
const getAsync = promisify(client.get).bind(client);
const setAsync = promisify(client.set).bind(client);
(async function redisTest() {
try {
// await setAsync('test-key','hello world');
const fromRedis = await getAsync('test-key');
console.log(fromRedis);
}
catch(e) {
console.log(e);
}
}());