co-nano-db

Exposes couchdb nano library db APIs as thunks for use with co and koa.

co-nano

Exposes couchdb nano library db API as thunks for use with co and koa.

Install with npm install co-nano-db

nano methods return (err, body, header), meaning the co-nano wrappers will throw err, and yield [body, header].

Usage:

var co = require('co');
var nano = require('nano')('http://localhost:5984/database-name');
var coNano = require('co-nano')(nano);

co(function *() { // Or inside a koa handler
  var res = yield coNano.insert({hello: 'world'}, 'myDocument');
  var body = res[0], headers = res[1];
})();