cradle - A high-level, caching, CouchDB client for Node.js
Intended to be a higher-level API on top of Couch, cradle from Alexis Sellier tries to bridge what’s best about CouchDB and Node.js. Cradle comes with built-in write-through caching to boost speed and easier updates and deletes.
Most methods from CouchDB map one-to-one with Cradle although some like save
can orchestrate multiple operations.
From the README
var cradle = require('cradle');
var db = new(cradle.Connection).database('starwars');
db.get('vador').addCallback(function (doc) {
doc.name; // 'Darth Vador'
assert.equal(doc.force, 'dark');
});
db.save('skywalker', {
force: 'light',
name: 'Luke Skywalker'
}).addCallback(function (res) {
// Handle success
}).addErrback(function (res) {
// Handle error
});
Discussion
Sign in or Join to comment or subscribe