Skip to content

rpl/ncouch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

yet another collection of couchdb node utilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published