title: extending a module when module is using "module.exports"
body: <p>I've read a few pages on extending a module.They revolve around using a functional form of a module and I get how to do it  (from <a href="https://toddmotto.com/mastering-the-module-pattern/" rel="nofollow">https://toddmotto.com/mastering-the-module-pattern/</a>)</p>
  
  <pre><code>var Module = (function () {
  
    return {
      publicMethod: function () {
        // code
      }
    };
  
  })();
  </code></pre>
  
  <p>but what I have is two modules like this</p>
  
  <p><code>util.js</code></p>
  
  <pre><code>module.exports = {
      thing1: function() {// do thing1 stuff }      
  }
  </code></pre>
  
  <p><code>extend.js</code>  a package I can't change (from npm)</p>
  
  <pre><code>module.exports = {
      thing2: function() {// do thing2 one stuff}
  }
  </code></pre>
  
  <p>now pretending I am going to use my util.js module</p>
  
  <pre><code>const _ = require('util.js);
  
  let catin = _.thing1;  // that's easy
  let thehat = _.thing2;.  // this was util.js extended.
  </code></pre>
  
  <p>I could in <code>util.js</code> just do this.</p>
  
  <pre><code>const ex = require('extend.js')
  
  module.exports = {
      thing1: function() {// do thing1 stuff }
      thing2: ex.thing2
  }
  </code></pre>
  
  <p>and that's ok since extend.js only has one function/method to extend, but I would like to extend this into my util library  <a href="https://github.com/dodekeract/bitwise/blob/master/index.js" rel="nofollow">https://github.com/dodekeract/bitwise/blob/master/index.js</a> but it has 22! items to extend.  </p>
  
  <p>There must be a better slicker way yes?  </p>
  
  <p>I'm open to refactoring my util.js file (but not hand coding each extension like I showed) so it extends automatically but obviously can't refactor that package I'm not maintaining, short of a fork...ugh.  Also not interested in adding a sub deal like   </p>
  
  <pre><code>  ex: ex 
  
  _.ex.thing2  
  </code></pre>
  
  <p>Ideas?</p>