title: how can return value with require file in node js?
body: <p>I am new to node.js , and use ari client.
  I have two .js files that first one is required in second one. I have declared a variable in second one that must contain return value of first file but console.log(variable) is undefined although in first file return value is not null.</p>
  
  <p>in first file :</p>
  
  <pre><code>var db = require("./database.js");
  var service_info = db.select(connection,'select * from services where ivr_shortcode = ?',service);
  console.log(service_info);
  </code></pre>
  
  <p>service_info is undefined;</p>
  
  <p>in second file :</p>
  
  <pre><code>this.select = function (connection,query,data){
  connection.query(query,[data],function(err, results){
      if(err)
      {
          throw err;
      }
      else
      {
          return results;
      }
  });}
  </code></pre>