title: Best practice for structuring libraries to be required in node.js
body: <p>I have several utility libraries which contain helper functions and I want to load them in order they can be used from the controllers and I'm wondering 
  what is the best practice for coding utility libraries in node.</p>
  
  <p>I'm little bit confused because there are several ways to do it and I'm not sure what is the best/more suitable/more reliable. Here are 2 options but I'm wondering if they are the best (for example I've seen snippets that use <code>module.exports = exports = function(){}</code>, etc)</p>
  
  <p>//option1.js</p>
  
  <hr>
  
  <pre><code>"use strict";
  
  module.exports =  function(){
  
       exports.test1 =  function(){ console.log('hi I'm test1')};
       exports.test2 =  function(){ console.log('hi I'm test2')};
       return exports;
  };
  </code></pre>
  
  <p>//option2.js</p>
  
  <pre><code>"use strict";
  
  module.exports =  {
  
       test1 : function(){ console.log('soy test1')},
       test2 :  function(){ console.log('soy test2')}
  
  };
  </code></pre>
  
  <p>//test_controller.js</p>
  
  <pre><code>/* Requiring helpers in different ways */
  var option1 = require('./option1.js')();
  var option2 = require('./option2.js');
  </code></pre>