Skip to content

Commit

Permalink
Tutorial + index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
felixge committed Feb 5, 2010
1 parent bb0947a commit a7e4bf9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
@@ -1,6 +1,36 @@
# Node.js CouchDB module

# Todo
A thin node.js idiom layer for CouchDB's REST API that tries to stay close to the metal.

## Tutorial

Installation is simple:

$ cd ~/.node_libraries
$ git clone git://github.com/felixge/node-couchdb.git

To use the library, create a new file called `my-couch-adventure.js`:

var
sys = require('sys'),
couchdb = require('node-couchdb'),
client = couchdb.createClient('localhost', 5984),
db = client.db('my-db');

db
.saveDoc('my-doc', {awesome: 'couch fun'})
.addCallback(function() {
sys.puts('Saved my first doc to the couch!');
});

db
.getDoc('my-doc')
.addCallback(function(doc) {
sys.puts('Fetched my new doc from couch:');
sys.p(doc);
});

## Todo

* Authentication
* Write docs
Expand Down
2 changes: 2 additions & 0 deletions index.js
@@ -0,0 +1,2 @@
// For your convenience
process.mixin(exports, require('./lib/couchdb'));

0 comments on commit a7e4bf9

Please sign in to comment.