couch-init2
An opiniated CouchDB databases initializer
Takes a list of databases to initialise and their design docs, and make sure that everything is up and running and in sync.
Installation
in a terminal, at the root of your project
npm install couch-init2 --save
How To
var dbUrl = 'http://username:password@localhost:5984'
var dbsList = [
{
name: 'dbname1',
designDocs: ['designdoc1']
},
{
name: 'dbname2',
designDocs: ['designdoc2', 'designdoc3']
},
{
name: 'dbname3',
designDocs: []
}
]
var designDocFolder = '/path/to/your/design/docs/folder'
couchInit(dbUrl, dbsList, designDocFolder)
.then(function (res) {
})
.catch(function (err) {
What it does
- create databases if missing
- create or update design documents if not up-to-date
- create security documents if missing