0.0.1 • Published 10 years ago

co-nano-db v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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];
})();