title: Require() function in JavaScript
body: <p>When I open console of Chrome 14 and type...</p>
  
  <p><code>require</code> (or <code>require()</code>, if that matters)</p>
  
  <p>I get: <code>ReferenceError</code>.</p>
  
  <p>This means that JavaScript doesn't have that function by default, right? At least on web browsers.</p>
  
  <p><em>Why I'm talking about that?</em><br>
  I needed Markdown parser for JavaScript.</p>
  
  <p><em>What to do?</em><br>
  I, as usually, opened GitHub and <a href="https://github.com/search?type=Everything&amp;language=JavaScript&amp;q=markdown&amp;repo=&amp;langOverride=&amp;x=28&amp;y=16&amp;start_value=1" rel="noreferrer">searched</a> for it. The first results that matched my needs was <a href="https://github.com/evilstreak/markdown-js" rel="noreferrer">this</a> and <a href="https://github.com/chjj/marked" rel="noreferrer">this</a>.</p>
  
  <p>Usually (I'm not that good with JavaScript) I include script I want to use before my code using <code>&lt;script /&gt;</code> tag and then... well - use it. But this time I don't get what's happening... :(</p>
  
  <p><strong>Usage for #1 script:</strong></p>
  
  <pre><code>var input = "# Heading\n\nParagraph";
  var output = require( "markdown" ).toHTML( input );
  print( output );
  </code></pre>
  
  <p><strong>Usage for #2 script:</strong></p>
  
  <pre><code>var marked = require('marked');
  console.log(marked('i am using __markdown__.'));
  </code></pre>
  
  <p>Where does that <code>require()</code> came from? Thanks in an advice! :)</p>