title: Issue with module wrapper function
body: <p>I'm trying to learn node.js, and having an issue with running a code with module wrapper function. Here is the code</p>
  <p>logger.js (1)</p>
  <pre><code>var url = 'http://mylogger.io/log';
  
  function log(message) {
      
      console.log(message);
  }
  
  module.exports.log = log;
  </code></pre>
  <p>logger.js(2)</p>
  <pre><code>( function (exports, require, module, __filename, __dirname)
  {
      var url = 'http://mylogger.io/log';
  
      function log(message) {
          
          console.log(message);
      }
  
      module.exports.log = log;
  })
  </code></pre>
  <p>app.js</p>
  <pre><code>const logger = require('./logger.js')
  console.log(logger);
  logger.log('Hiya');
  </code></pre>
  <p>The logger.js(1) works fine, logger.js(2) gives out following error.</p>
  <pre><code>TypeError: logger.log is not a function
      at Object.&lt;anonymous&gt; ()
      at Module._compile (node:internal/modules/cjs/loader:1092:14)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
      at Module.load (node:internal/modules/cjs/loader:972:32)
      at Function.Module._load (node:internal/modules/cjs/loader:813:14)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
      at node:internal/main/run_main_module:17:47
  </code></pre>
  <p>I was expecting to get the same result from both cases</p>