node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org ยป



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].


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];