title: Node.js object is not a function - module.exports
body: <p>I have a module I created for a node.js app.  The app also uses socket.io and I want to pass the socket.io object into the auction object when I create it.</p>
  
  <p>This works when I do it outside of Node, but inside, I get the error 'object is not a function' -  my guess is it has to do with the module.exports, but I'm sure what it would be.</p>
  
  <p>Any suggestions would be awesome - thank you!</p>
  
  <p>auction.js</p>
  
  <pre><code>var Auction = function(socket) {
      this.data      = [];
      this.timer     = null;
      this.socket    = socket;
  }
  
  Auction.prototype = {
  
      add: function(auction) {
          this.data.push(auction);
      }
  }
  
  
  module.exports.Auction = Auction;
  </code></pre>
  
  <p>server.js:</p>
  
  <pre><code>var  Auction          = require('./lib/auction');
  
  var auctions = new Auction(socket);
  </code></pre>
  
  <blockquote>
    <p>Error: TypeError: object is not a function
        at Object.CALL_NON_FUNCTION_AS_CONSTRUCTOR (native)</p>
  </blockquote>