node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org ยป



Manage versioning and updates of your couchdb design documents while using cradle.

var client = require('grave').connect('localhost', 5984);
var db = client.db('webshizzle');

var design ='users', '0.0.2');

design.view('all', {
    map : function (doc) {
        if (doc.type === 'user') emit(doc._id, doc);


Manny Calavera rocking the cradle



Pass through arguments to cradle.Connection and return a new "client" handle.


Return a cradle database handle with an extra method,, version)

Start a design with a name and a version. Theversion should be understood by semver.

design.view(name, view)

Define a couchdb view. CouchDB views have map, reduce, and fields of that sort.

design.list(name, list)

Define a couchdb list. CouchDB lists are functions that look like function (head, req) { /* ... */ }.

design.update(name, update)

Define a couchdb update. These look like function (doc, req) { /* ... */ }.


Declare the end of the design document definitions and save them to couchdb when the design version is greater than the couchdb version.


tanepiper came up with this idea. It's all his fault!