title: module.exports function undefined when passing in a variable
body: <p>In my Node.js app, I'm passing in variables to functions by using <code>require</code> like so:</p>
  
  <pre><code>console.log(require('../controllers/controller')(variable)); // undefined
  </code></pre>
  
  <p>However, when I don't pass in the variable, it logs as a function, like so:</p>
  
  <pre><code>console.log(require('../controllers/controller')); // [Function]
  </code></pre>
  
  <p>My controllers are defined like this:</p>
  
  <pre><code>var Controller = function (variable) {
    this.variable = variable;
  };
  
  Controller.prototype.method = function (someInput, callback) {
    // can access this.variable;
  };
  
  module.exports = Controller;
  </code></pre>
  
  <p>I also get this error:</p>
  
  <pre><code>TypeError: Object function (variable) {
    this.variable = variable;
  } has no method 'method'
  </code></pre>
  
  <p>Any idea as to where I'm going wrong here? I'm stuck at this step and not sure how to debug further.</p>