mikeal/couch — pull request #2 by KenPowers (2014-07-12 18:32:08+00:00)
Title: Export Couch constructor.

Exporting the `Couch` constructor function allows more flexibility in the usage of the module. For example, promisifying the `Couch` prototype with [Bluebird](https://github.com/petkaantonov/bluebird):

```javascript
var couch = require('couch'),
Promise = require('bluebird');
Promise.promisifyAll(couch.Couch.prototype);

var c = couch('http://me.iriscouch.com/db');

c.post({msg: 'new document'}).then(function (info) {
return c.post({'msg':'new document', _id:info.id, _rev:info.rev});
}).then(function (info) {
return c.get(info.id);
}).then(function (doc) {
console.log(doc); // {'msg':'new document', _id:, _rev:}
}).catch(function (e) {
// All errors bubble here
});
```