co-nano-db
v0.0.1
Published
Exposes couchdb nano library db APIs as thunks for use with co and koa.
Downloads
2
Maintainers
Readme
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];
})();