runsv-couchdb
v0.0.3
Published
runsv couchdb service wrapper
Downloads
119
Readme
runsv CouchDB (apache-nano client) service
This is a service wrapper around the excellent nano for runsv.
Install
If you have already installed nano
$ npm install runsv-couchdb
Otherwise
$ npm install nano runsv-couchdb
nano is a peer dependency
Usage
const runsv = require('runsv')();
const couchdb = require('runsv-couchdb')(/* nano config here*/);
runsv.addService(couchdb);
runsv.start(function(err, clients){
const {couchdb} = clients;
//your program goes here
});
Configure nano
You can configure your connection to couchdb the same way you you do it with nano
.
// --- Configuration example comparison ---
// Create client with nano
const nano = require('nano')('http://localhost:5984/my-db');
// Create a service wrapper with runsv-couchdb
const runsvCouchdb = require('runsv-couchdb')('http://localhost:5984/my-db');