title: How to Check if a Class Exists in Node with a String
body: <p>Let's say I have this code:</p>
  
  <pre><code>Person = {};
  var person = new Person();
  </code></pre>
  
  <p>Where Person is a class I defined in the file Person.js. Before invoking the code that executes above, I want to check to see if the Person class exists and if not I want to include it using require('./'+className). Doing this all dynamically, I only have a string to start with:</p>
  
  <pre><code>var className = 'Person';
  </code></pre>
  
  <p>How do I use my className string to identify if Person exists in Node JS? I know in the browser I can do this:</p>
  
  <pre><code>if(window[className])
  </code></pre>