Registry / database / pouchdb-http

pouchdb-http

JSON →
library6.0.2jsnpmunverified

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.

npm install pouchdb-http
INSTALL
IMPORT
SIG · POUCHDB-HTTP
P
pouchdb-http
databasejavascriptv6.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PouchDB
const PouchDB = require('pouchdb-http');
import PouchDB from 'pouchdb-http';
This package, at version 6.0.2, primarily uses CommonJS `require`. Direct ES module `import` syntax is not supported for this version and will result in errors.
PouchDB.plugin
const PouchDB = require('pouchdb-http').plugin(require('pouchdb-mapreduce'));
import PouchDB from 'pouchdb-http'; PouchDB.plugin(MapReducePlugin);
Plugins are added using the `.plugin()` method on the PouchDB constructor. Ensure the plugin itself is also required via CommonJS for compatibility with this older version.

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); });
Debug
Known issues
breakingThis package is at version 6.0.2, while the main PouchDB library is significantly more advanced (v8.x). It is considered abandoned and has not received updates since 2017. Using this package means foregoing bug fixes, performance improvements, and security patches present in newer PouchDB versions.
fix
Consider migrating to the full `pouchdb` package or a more actively maintained subset if available, and explicitly disable unused adapters if bundle size is a concern.
affects: >=6.0.2
gotchapouchdb-http only provides the HTTP adapter. It does not include local storage adapters (like IndexedDB, WebSQL, or LevelDB) or the `query()` API (map/reduce) by default. Attempts to use `PouchDB('mydb')` without an HTTP URL or to call `db.query()` will fail unless specific plugins are added.
fix
For map/reduce, explicitly add `require('pouchdb-mapreduce')` as a plugin. For local storage, use the full `pouchdb` package or an alternative. Always use a full HTTP URL (e.g., `new PouchDB('http://localhost:5984/mydb')`).
affects: >=6.0.2
breakingDue to its age, `pouchdb-http` (v6.0.2) is not officially compatible with modern Node.js versions (e.g., Node.js 16+ or ESM-only environments). It relies heavily on CommonJS `require` syntax and may not function correctly without specific transpilation or legacy runtime settings.
fix
Use a compatible Node.js version (e.g., Node.js 14 or older) or ensure your build setup correctly transpiles or handles CommonJS modules in an ESM context. For new projects, avoid this package entirely.
affects: >=6.0.2
Errors
Common errors & fixes
TypeError: db.query is not a function
`pouchdb-http` does not include map/reduce (the `query` API) by default.
fix
Add the map/reduce plugin: `const PouchDB = require('pouchdb-http').plugin(require('pouchdb-mapreduce'));`
UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'get')
Attempting to create a local PouchDB instance without a specified HTTP URL, and no local adapter is present.
fix
Always initialize `pouchdb-http` with a full HTTP/HTTPS URL to a CouchDB-compatible server, e.g., `new PouchDB('http://127.0.0.1:5984/mydb')`.
SyntaxError: Named export 'PouchDB' not found. The requested module 'pouchdb-http' does not provide an export named 'PouchDB'
Attempting to import `pouchdb-http` using ES module syntax (e.g., `import { PouchDB } from 'pouchdb-http';`) which is not supported by this CommonJS-only package version.
fix
Use CommonJS `require` syntax: `const PouchDB = require('pouchdb-http');`
Upgrade
Version history
6.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
pouchdb-http — npm install pouchdb-http · libregistry