title: How do I split a class definition across multiple files in node.js?
body: <p>My class definition for <code>Foo</code> that has grown to the point that I'd like to split it across multiple files.  For example, I'd like something like:</p>
  
  <pre><code>// file foo.js
  'use strict';
  function Foo() { };
  Foo.prototype.constructor = Foo;
  Foo.prototype.methodA = function() { console.log('methodA'); };
  module.exports = Foo;
  
  // file foo-aux.js
  'use strict';
  Foo.prototype.methodB = function() {
    console.log('methodB');
    this.methodA();
  };
  
  // file main.js
  'use strict';
  const Foo = require('./foo');
  var foo = new Foo();
  foo.methodB();
  </code></pre>
  
  <p>What's the right combination of <code>module.export</code> and <code>require()</code> to make the above code work?</p>