title: Node Modules and Prototype Inheritance
body: <p>Currently I have:</p>
  
  <p>index.js (in module foo)</p>
  
  <pre><code>function Foo(options) {
      this.memberVar = options.memberVar;
  }
  
  Foo.prototype.bar = function(word) {
      console.log('word: ', word);
  }
  
  module.exports = Foo;
  </code></pre>
  
  <p>server.js (in separate module bar) </p>
  
  <pre><code>var Foo = require('foo'),
      foo = new Foo(options),
      greeting = 'Hello World!';
  
  foo.bar(greeting); // prints Hello World!
  </code></pre>
  
  <p>This is nice and all but I feel it could be prettier and easier for others to understand if I didn't have to use the new keyword to instantiate a new foo object to expose its member functions.</p>
  
  <p>So here's what I would like to be able to do: </p>
  
  <pre><code>var greeting = 'Hello World!',
      foo = require('foo')(options);
  foo.bar(greeting); // prints Hello World!
  </code></pre>
  
  <p>How do I modify my current foo - index.js to be able to access the Foo object as described in the code snippet above?</p>