PouchDB-node is the specialized Node.js distribution of PouchDB, a JavaScript database inspired by Apache CouchDB. It enables developers to store, query, and sync data offline in Node.js environments. Unlike the full PouchDB build, `pouchdb-node` is optimized for server-side use, utilizing LevelDB for local storage and omitting browser-specific adapters like IndexedDB or WebSQL. The current stable version is 9.0.0, released in late 2025/early 2026. Major versions are released periodically (e.g., 7.0.0, 8.0.0, 9.0.0), often introducing significant architectural changes like moving to modern ES6+ syntax or internal refactors. Patch releases are more frequent, addressing bugs and dependency updates. Its key differentiator is its Node.js-first approach, bundling core features like replication, HTTP, and map/reduce without browser bloat.
npm install pouchdb-nodeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize a PouchDB database in Node.js using `pouchdb-node`, create, read, update, and delete a document, and finally destroy the database. It uses a temporary directory for storage.
Ensure your Node.js environment supports ES6+ features. Update your code to align with PouchDB's updated API and internal structure. Review the PouchDB 8.0.0 changelog for specific deprecated methods or properties.
Thoroughly review the PouchDB 9.0.0 changelog and migration guide on the official PouchDB website or GitHub releases page. Test your application extensively after upgrading.
Ensure your environment is Node.js. If you need a universal build or browser functionality, use the full `pouchdb` package or a custom build with the desired adapters. Do not pass browser-specific adapter options (e.g., `adapter: 'indexeddb'`) to `pouchdb-node`.
For replication, HTTP, and map/reduce functionalities, rely on the versions bundled with `pouchdb-node`. Only manually include other plugins that are not part of the `pouchdb-node` preset.
Run `npm install pouchdb-node` or `yarn add pouchdb-node` in your project directory. Ensure your Node.js module resolution paths are correctly configured if you're using a monorepo or custom setup.
For CommonJS, use `const PouchDB = require('pouchdb-node');`. For ES Modules, use `import PouchDB from 'pouchdb-node';`. If you are transpiling, ensure your Babel/TypeScript configuration correctly handles module interop.Verify that `leveldown` and `levelup` (dependencies of `pouchdb-adapter-leveldb`) are correctly installed and compiled for your system. Reinstall `pouchdb-node` or `leveldown` to resolve potential native module compilation issues. Check Node.js version compatibility with LevelDB.