npm install hiredis redisvar redis = require("redis");/**Enter your Tendis instance private IP, port number, instance ID, and password in the following parameters*/var host = "192.xx.xx.2",port = "6379",instanceid = "c53xx52f-55dc-4c22-a941-630xxx88",pwd = "12as6zb";// Connect to the Tendis instancevar client = redis.createClient(port, host, {detect_buffers: true});// Connection errorclient.on("error", function(error) {console.log(error);});// Authenticateclient.auth(instanceid + ":" + pwd);/**You can start manipulating the Tendis instance. */// Set the keyclient.set("redis", "tencent", function(err, reply){if (err) {console.log(err);return;}console.log("set key redis " + reply.toString() + ", value is tencent");});// Get the keyclient.get("redis", function (err, reply) {if (err) {console.log(err);return;}console.log("get key redis is:" + reply.toString());// End the program and close the clientclient.end();});

Feedback