title: Use require/new to instantiate a new object in node.js
body: <p>I have very simple beginner problem using node.js but I cannot seem to get it to work correctly. </p>
  
  <p>All I want is to be able to create objects using the 'new' operator in the index.js file.
  For demonstration purposes, I have created a simple <code>Person</code> object inside a Person.js file (which lies in the same directory as my index.js) like this:</p>
  
  <pre><code>class Person {
    constructor() {
      this._name = 'bob';
    }
  
    set name(name) {
      this._name = name
    }
  
    get name() {
      return this._name;
    }  
  }
  </code></pre>
  
  <p>Now I want to do something like this (in the index.js file):</p>
  
  <pre><code>var p = require('./Person.js')
  var bob = new p.Person()
  </code></pre>
  
  <p>The error message I get is telling me that Person is not a constructor:</p>
  
  <pre><code>var bob = new p.Person()
        ^
  
  TypeError: p.Person is not a constructor
  at Object.&lt;anonymous&gt; (/home/.../index.js:59:11)
  at Module._compile (module.js:652:30)
  at Object.Module._extensions..js (module.js:663:10)
  at Module.load (module.js:565:32)
  at tryModuleLoad (module.js:505:12)
  at Function.Module._load (module.js:497:3)
  at Function.Module.runMain (module.js:693:10)
  at startup (bootstrap_node.js:188:16)
  at bootstrap_node.js:609:3
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>