title: What's the recommended way of creating objects in NodeJS?
body: <p>I'm building a composite for <code>request</code> module, however I'm not sure what's the best practice regarding building objects in JS for Node.</p>
  
  <p>Option 1:</p>
  
  <pre><code>function RequestComposite(request) {
    return {
      get: function (url) { return request.get(url); }
    }
  }
  var comp = RequestComposite(request);
  </code></pre>
  
  <ul>
  <li>Note: I know that i should call a CB in async way, but for the ease of explaination I return it...</li>
  </ul>
  
  <p>Option 2:</p>
  
  <pre><code>function RequestComposite(request) {
    this.request = request;
  }
  
  RequestComposite.prototype.get = function (url) { return this.request.get(url); };
  var comp = new RequestComposite(request);
  </code></pre>
  
  <p>Option 3:</p>
  
  <pre><code>var RequestComposite = {
    init: function (request) { this.request = request; },
    get: function (url) { return request.get(url); }
  }
  var comp = Object.create(RequestComposite).init(request);
  </code></pre>
  
  <p>I tried to find my way around, however I got even more confused about how should I use objects...</p>
  
  <p>Would the answer be different if I want to use objects for browsers?</p>
  
  <p>Thanks.</p>