title: "XXX.foo is not a function" after browserify two files into bundle
body: <p>I use browserify to bundle two java script files into one with following command:</p>
  <p><code>browserify X1.js X2.js --standalone XXX &gt; bundle.js</code></p>
  <p>X1.js contains following function:</p>
  <pre><code>function foo() {
     console.log(&quot;something&quot;)
  }
  </code></pre>
  <p>And I'm exporting it that way:</p>
  <pre><code>module.exports = {foo: foo};
  </code></pre>
  <p>What I want to do is call that function inside my index.html like this:</p>
  <pre><code>XXX.foo()
  </code></pre>
  <p>And it seems like it recognizes &quot;XXX&quot; module, but not &quot;foo&quot; function. Why is that a case?</p>
  <blockquote>
  <p>Uncaught TypeError: XXX.foo is not a function</p>
  </blockquote>