Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
yet another collection of couchdb node utilities
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
features
lib
.gitignore
README.md
couchdb-user-test.ini
package.json

README.md

README - n-couch

ncouch is yet another collection of couchdb node utilities.

It can be used as a command line tools (as in couchapp) or as a commonjs modules.

Getting Started

CLI

Create a new project and run a testing couchdb instance

$ ncouch generate project hellocouch
ncouch v0.1.0beta
Creating 'hellocouch' ncouch project dir...
Creating 'design' dir...
Creating 'example' design doc...
Creating 'example' design doc resource directories (attachments and libs)...

couchdb -a couchdb-user-test.ini
...

In another shell:

$ cd hellocouch

hellocouch$ ncouch push http://admin:admin@localhost:5984/hellocouch
ncouch v0.1.0beta
pushing... example.js
    CREATING DESIGN DOC '_design/example'.

An ncouch design doc is a node commonjs module which exports design_doc, attachments and libs attributes:


// design/test1.js
exports.attachments = {
  res_dir: ""test1/attachments", 
  exclude_rx_list: [/.*~/]
};

exports.libs = {
  res_dir: "test1/libs", 
  exclude_rx_list: [/.*~/]
};

exports.design_doc = {
  validate_doc_update: function(newDoc, oldDoc, userCtx) {
    ...
  },
  views: {
    ...
  }
};

CommonJS Module

TODO

Something went wrong with that request. Please try again.