diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/redis/examples/extend.js')
-rw-r--r-- | vnfmarket/src/main/webapp/vnfmarket/node_modules/redis/examples/extend.js | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/redis/examples/extend.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/redis/examples/extend.js deleted file mode 100644 index 488b8c2d..00000000 --- a/vnfmarket/src/main/webapp/vnfmarket/node_modules/redis/examples/extend.js +++ /dev/null @@ -1,24 +0,0 @@ -var redis = require("redis"), - client = redis.createClient(); - -// Extend the RedisClient prototype to add a custom method -// This one converts the results from "INFO" into a JavaScript Object - -redis.RedisClient.prototype.parse_info = function (callback) { - this.info(function (err, res) { - var lines = res.toString().split("\r\n").sort(); - var obj = {}; - lines.forEach(function (line) { - var parts = line.split(':'); - if (parts[1]) { - obj[parts[0]] = parts[1]; - } - }); - callback(obj) - }); -}; - -client.parse_info(function (info) { - console.dir(info); - client.quit(); -}); |