title: NodeJS Module exports / prototype - has no method
body: <p>I've got a module that looks like this:</p>
  
  <pre><code>var MyModule = module.exports = function MyModule(opts) {
  
      opts = (opts === Object(opts)) ? opts : {};
  
      if (!(this instanceof MyModule)) {
          return new MyModule(opts);
      }
  
      for (var key in opts) if ({}.hasOwnProperty.call(opts, key)) {
          this.config[key] == opts[key];
      }
  };
  
  MyModule.prototype.config = {
      something:'value'
  }
  
  MyModule.prototype.put = function put(info, cb) {
     //do stuff
  
  };
  </code></pre>
  
  <p>However, when I use it like this:</p>
  
  <pre><code>var myModule = require('myModule.js');
  
  myModule.put({test}, function(){
      //some callback stuff
  });
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>TypeError: Object function MyModule(opts) {</p>
  
  <pre><code>opts = (opts === Object(opts)) ? opts : {};
  
  if (!(this instanceof MyModule)) {
      return new MyModule(opts);
  }
  
  for (var key in opts) if ({}.hasOwnProperty.call(opts, key)) {
      this.config[key] == opts[key];
  } } has no method 'put'
  </code></pre>
  </blockquote>
  
  <p>It appears I have something wrong with my <code>MyModule.prototype.put</code> ?</p>