module.exports vs. export default in Node.js and ES6
<p>What is the difference between Node's <code>module.exports</code> and ES6's <code>export default</code>? I'm trying to figure out why I get the "__ is not a constructor" error when I try to <code>export default</code> in Node.js 6.2.2.</p>

<h3>What works</h3>

<pre><code>'use strict'
class SlimShady {
  constructor(options) {
    this._options = options
  }

  sayName() {
    return 'My name is Slim Shady.'
  }
}

// This works
module.exports = SlimShady
</code></pre>

<h3>What <em>doesn't</em> work</h3>

<pre><code>'use strict'
class SlimShady {
  constructor(options) {
    this._options = options
  }

  sayName() {
    return 'My name is Slim Shady.'
  }
}

// This will cause the "SlimShady is not a constructor" error
// if in another file I try `let marshall = new SlimShady()`
export default SlimShady
</code></pre>