1 var redis = require("redis"),
2 client = redis.createClient();
4 // Extend the RedisClient prototype to add a custom method
5 // This one converts the results from "INFO" into a JavaScript Object
7 redis.RedisClient.prototype.parse_info = function (callback) {
8 this.info(function (err, res) {
9 var lines = res.toString().split("\r\n").sort();
11 lines.forEach(function (line) {
12 var parts = line.split(':');
14 obj[parts[0]] = parts[1];
21 client.parse_info(function (info) {