Deploy CouchDB documents from directory, JSON or CommonJS module. Via API or command line client.
push(db, source[, options], callback)
db
- URL to a CouchDB database. Auth URLs are OK. See nanos configuration, as this argument is directly passed to nano. As of v1.5.0 a nano object is supported, too.source
- Can be a Couchapp Directory Tree, JSON file or CommonJS/Node module. Please see couchdb-compile for in depth information about source handling.options.index
- When set totrue
, folders are searched forindex.js
, which, if present, is treated as CommonJS module. Default isfalse
.options.multipart
- if set totrue
, attachments are saved via multipart api.callback
- called when done with two arguments:error
andresponse
.
var push = require('couchdb-push');
push('http://localhost:5984/my-app', 'project/couchdb', function(err, resp) {
// { ok: true }
});
couchdb-push DB [SOURCE] [OPTIONS]
When SOURCE
is omitted, the current directory will be used.
OPTIONS
can be --index
or --multipart
, see above.
couchdb-push http://localhost:5984/my-app project/couchdb
npm test
(c) 2014 Johannes J. Schmidt, TF
MIT License