title: Module exports using two diffrent approches
body: <p>I've node app with the following code( I put sample of the code structure)</p>
  
  <p>This code in the <strong>server.js</strong>  which is the <strong>entry point</strong> to my <strong>nodeModule</strong></p>
  
  <pre><code>function run() {
      app.listen(3001, function () {
          console.log("App is listenting on port 3000");
      })
  }
  
  function addPath(args) {
      plug.loadF(args.loadFolder);
  };
  
  function preProcess (args) {
  
      if (_.isEmpty(args)) {
          run();
      }
  };
  
  module.exports = preProcess();
  module.exports ={
      run: run,
      addPath: addPath
  }
  </code></pre>
  
  <p>As you can see the exports twice which in this way I support both option when the app/module is called from <strong>CMD</strong> (call to server.js) and <strong>second</strong> is for calling with using code as dependency under node_modules</p>
  
  <ol>
  <li><p>for <code>module.exports = preProcess();</code>
  <code>module.exports = preProcess();</code> is if my app/nodeModule is called from external program like java/ buildpack and no args are passed</p></li>
  <li><p>exports <code>run</code> and <code>addPath</code> which is if my module is installed as node_moudule in user app and you want to call those API by code</p></li>
  </ol>
  
  <p>My question is there is better way in node to write  those <strong>exports</strong> or if it's ok?</p>