title: what is this "require" thing?
body: <p>I see this in many JS libraries out there, mostly looking through GitHub, currently looking at <a href="https://github.com/peers/peerjs" rel="nofollow">PeerJS</a>. I'm referring to this:</p>
  
  <pre><code>var util = require('./util');
  var EventEmitter = require('eventemitter3');
  var Negotiator = require('./negotiator');
  var Reliable = require('reliable');
  ...
  window.Socket = require('./socket');
  window.MediaConnection = require('./mediaconnection');
  window.DataConnection = require('./dataconnection');
  window.Peer = require('./peer');
  window.RTCPeerConnection = require('./adapter').RTCPeerConnection;
  window.RTCSessionDescription = require('./adapter').RTCSessionDescription;
  window.RTCIceCandidate = require('./adapter').RTCIceCandidate;
  window.Negotiator = require('./negotiator');
  window.BinaryPack = require('js-binarypack');
  ...
  </code></pre>
  
  <p>Just from intuition, it seems like <code>require()</code> is importing/including whatever is being passed in, i.e., <code>EventEmitter</code>. However, I can't figure out where <code>require()</code> is coming from?</p>
  
  <p>I'm not too familiar with NodeJS, and this seems like it's a NodeJS thing, but I don't understand how <code>require()</code> fits into a web browser context, where NodeJS doesn't exist.</p>
  
  <p>I've seen <a href="http://requirejs.org/" rel="nofollow">RequireJS</a> and <a href="http://browserify.org/" rel="nofollow">Browserify</a>, but these are libraries that would need to be included with application in order to use the <code>require()</code> function. In the example of PeerJS, I can just include it:</p>
  
  <pre><code>&lt;script type="text/javascript" src="/static/js/peerjs.v0.3.13.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>... and it uses <code>require()</code> no problem. However, it doesn't look like there's any 3rd party libraries that are defining <code>require()</code> that are being bundled along with the PeerJS source code.</p>
  
  <p>How is it being included? How is it being initialized? How is it fetching whatever is being passed in, i.e., "EventEmitter"?</p>