title: Force to pass an argument during require of module
body: <p>I am working on a node_module where I want to force users to pass in a string argument during require, like this:</p>
  <pre><code>const module = require('mymodule')('argument')
  </code></pre>
  <p>Then I have this on the module:</p>
  <pre><code>var someName = ''
  module.exports = function (name) {
    if (!name) console.log('Error!')
    someName = name
    console.log('Set someName: ' + someName)
  }
  </code></pre>
  <p>So this works fine. However, when I try to require like this:</p>
  <pre><code>const module = require('mymodule')
  </code></pre>
  <p>And I added this:</p>
  <pre><code>module.exports = () =&gt; {
    throw new Error('No name defined')
  }
  </code></pre>
  <p>It doesn't go in there and no error is thrown.</p>
  <p>How can I force users so that they will pass in an argument during require?</p>
  <p>Thanks!</p>