couch_set_state.js
// wrap call to config_okay, if needed
wrap call to config_okay, if needed
wrap call to config_okay if needed
function couchdb_set_state(opts,cb){
    if(config.couchdb.host === undefined && opts.config_file !== undefined){
        return config_okay(opts.config_file)
            .then(function(c){
                config.couchdb = c.couchdb
                return _couchdb_set_state(opts,cb)
            })
    }
    return _couchdb_set_state(opts,cb)
}
function couchdb_set_state ( opts , cb ) { if ( config . couchdb . host === undefined && opts . config_file !== undefined ) { return config_okay ( opts . config_file ) . then ( function ( c ) { config . couchdb = c . couchdb return _couchdb_set_state ( opts , cb ) } ) } return _couchdb_set_state ( opts , cb ) }
wrap call to config_okay, if needed
wrap call to config_okay if needed
// otherwise, hopefully everything is defined in the opts file!