http-pouchdb
Access remote CouchDB databases like you would access your local PouchDB
ones. Tested support for new PouchDB('name')
,
PouchDB.replicate('name', 'name')
, PouchDB.destroy('name')
and,
as a bonus, PouchDB.allDbs()
.
Example
npm install pouchdb http-pouchdb
var PouchDB = require('pouchdb');
var HTTPPouchDB = require('http-pouchdb')(PouchDB, 'http://localhost:5984');
var db = new HTTPPouchDB('_users');
console.log(HTTPPouchDB.isHTTPPouchDB)
Browser usage
<script src='somewhere/pouchdb.min.js'></script>
<script src='dist/http-pouchdb.min.js'></script>
<script>
var HTTPPouchDB = buildHTTPPouchDB(PouchDB, 'http://localhost:5984/test');
</script>
API
module.exports = function (PouchDB, name, opts) -> PouchDB2
name
: The base url you want to use. Needs a trailing '/'.opts
: opts.headers
and opts.auth
.