JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1744
  • Score
    100M100P100Q105343F
  • License Apache-2.0

Access remote CouchDB databases like you would access your local PouchDB ones.

Package Exports

  • http-pouchdb

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (http-pouchdb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

http-pouchdb

Build Status Dependency Status devDependency Status

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) //-> true
// 'db' will be backed by http://localhost:5984/_users ; You can use it
// like any PouchDB database.

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');
  // use HTTPPouchDB as above.
</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.