Does Node run all the code inside required modules? : <p>Are node modules run when they are required?</p>

<p>For example: You have a file foo.js that contains some code and some exports.</p>

<p>When I import the file by running the following code</p>

<pre><code>var foo = require(./foo.js);
</code></pre>

<p>is all the code inside the file foo.js run and only exported after that?</p>
