title: Writing a library, what structure?
body: <p>I'm writting a library. Right now, I have everything written in a single .js file that goes like:</p>
  
  <pre><code>function doThis() {}
  var thisVar = 5;
  </code></pre>
  
  <p>I was not sure if that was right, so I considered:</p>
  
  <pre><code>function Lib() {
    this.doThis = function() {}
    this.thisVar = 5;
  }
  
  var lib = new Lib();
  </code></pre>
  
  <p>Then, on the main program files, I would have to call everything with "lib.", such as "lib.thisVar" or "lib.doThis();".</p>
  
  <p>Any ideas on which would be better, or are they both acceptable? Thank you in advance.</p>