node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey ยป



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