title: Using a helper class easily in expressjs
body: <p>I'm using a pretty barebones expressjs app and want to add a library/helper to store some useful code. Ideally, I'd like it to work as a module. However, I'm unable to get it to work. Here's what I've got:</p>
  
  <pre><code>// helpers/newlib.js
  var NewLib = function() {
    function testing() {
      console.log("test");
    }
  };
  
  exports.NewLib = NewLib;
  </code></pre>
  
  <p>.</p>
  
  <pre><code>// controllers/control.js
  var newlib  = require('../helpers/newlib').NewLib;
  var helper = new NewLib();
  helper.testing();
  </code></pre>
  
  <p>.</p>
  
  <p>The error I get is <code>ReferenceError: NewLib is not defined</code>. I followed the design pattern (of how <code>exports</code> works) based on another simple module I downloaded.</p>
  
  <p>What am I doing wrong?</p>