title: Converting an external javascript library to a Node.js module
body: <p>I ran across <a href="http://simjs.com/basics.html">sim.js</a>, a library for discrete event simulation, and I thought it would be fun to use while learning node.js.  It's a single javascript file, with no dependencies on other libraries or the browser.</p>
  
  <p>What's the best practice for including this in my code base?  Save the .js to disk, and convert it to a standard node module?</p>
  
  <p>I.e.:</p>
  
  <pre><code>// ---sim.js
  var Sim = function () {
    this.simTime = 0;
    this.entities = [];
  }
  
  Sim.Event = function (name) {
    this.name = name;
  };
  // ... functions continue
  module.exports = Sim;
  
  // --- main.js
  var Sim = require('./sim');
  
  var sim = new Sim();
  var trafficLights = [new Sim.Event("North-South Light"),
                       new Sim.Event("East-West Light")]; 
  </code></pre>
  
  <p>Or is there an easier way that would not require modifying/modularizing the original js?</p>