title: How to to export both the class and superclass in Node.js using module.exports and require()?
body: <p>This may be obvious, but I do not understand how to use <code>module.export</code> to export both the subclass and superclass. I'm currently getting the error <code>ReferenceError: not defined</code>. Here's the an example subclass <code>Dalmatian</code> in <code>/js/dalmatian.js</code>:</p>
  
  <pre><code>class Dalmatian extends Dog{
    constructor(){
         super();
        /// stuff
    }
  }
  
  module.exports = {
    Dalmatian : Dalmatian
  }
  </code></pre>
  
  <p>If I then export this class in another <code>*.js</code> file, I run into problems:</p>
  
  <pre><code>require('../js/dog.js');   // this works
  require('../js/dalmatian.js');   // this fails
  
  ReferenceError: Dog is not defined
  </code></pre>
  
  <p>I don't understand. The super constructor is used within Dalmatian, i.e. <code>super();</code>. </p>
  
  <p>How do I export the base class (which here is <code>Dog</code>) so I don't get this error? </p>