title: Node.js request method callback
body: <p>client.get method does not work in redis for node.js</p>
  
  <pre><code>//blog function
  module.exports = {
    index: function () {
  
      var data = new Object();
      data.ip = base.ip();
  
      var redis = require("redis");
      var client = redis.createClient(6379,'192.168.33.10');
  
      client.get("foo",function(err,reply,callback)
      {
        var x=reply.toString();
      });
  
      data.y=x;
  
  
      return data;
    }
  
  
  };
  </code></pre>
  
  <p><code>data.y="bar"</code> expects but </p>
  
  <p><code>x is not defined.</code></p>
  
  <p>where is the problem?</p>