PouchDB HTTP-only Adapter

6.0.2 · abandoned · verified Wed Apr 22

PouchDB-http is a minimalist preset package designed to provide only the HTTP adapter for PouchDB. Its primary function is to allow applications to interact with a CouchDB-compatible server (like Apache CouchDB or Cloudant) without including any local storage adapters or map/reduce capabilities by default. This makes it suitable for scenarios where PouchDB is used purely as an interface to a remote database, reducing bundle size by omitting unnecessary features. The package is at version 6.0.2, which is significantly older than the current PouchDB core (8.x). As a result, its release cadence is effectively non-existent, and it lacks the continuous updates and features found in the main PouchDB project. Its key differentiator is its small footprint and specific focus on HTTP communication, but its age means it likely faces compatibility challenges with modern JavaScript environments and newer PouchDB plugins.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates initializing PouchDB with an HTTP endpoint and performing basic `put` and `get` operations using CommonJS syntax.

const PouchDB = require('pouchdb-http');

// Initialize PouchDB with a remote CouchDB URL
const db = new PouchDB('http://127.0.0.1:5984/mydb');

// Example: Put a document
db.put({
  _id: 'mydoc',
  title: 'Hello PouchDB HTTP',
  date: new Date().toISOString()
}).then((response) => {
  console.log('Document created:', response);
  return db.get('mydoc');
}).then((doc) => {
  console.log('Document retrieved:', doc);
}).catch((err) => {
  console.error('Error:', err);
});

view raw JSON →