{"library":"pouchdb-node","title":"PouchDB Node.js Edition","description":"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.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install pouchdb-node"],"cli":null},"imports":["import PouchDB from 'pouchdb-node';","const PouchDB = require('pouchdb-node');","import PouchDB from 'pouchdb-node';\nPouchDB.plugin(require('my-pouchdb-plugin'));"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import PouchDB from 'pouchdb-node';\nimport path from 'path';\nimport os from 'os';\n\nconst dbPath = path.join(os.tmpdir(), 'my_pouchdb_database');\nconst db = new PouchDB(dbPath);\n\nasync function runExample() {\n  try {\n    // Create a document\n    const doc = { _id: 'mydoc', name: 'My Test Document', value: Math.random() };\n    const response = await db.put(doc);\n    console.log('Document created:', response);\n\n    // Get the document\n    const fetchedDoc = await db.get('mydoc');\n    console.log('Document fetched:', fetchedDoc);\n\n    // Update the document\n    fetchedDoc.value = Math.random();\n    const updatedResponse = await db.put(fetchedDoc);\n    console.log('Document updated:', updatedResponse);\n\n    // Delete the document\n    const deleteResponse = await db.remove(fetchedDoc);\n    console.log('Document deleted:', deleteResponse);\n\n    // Get database info\n    const info = await db.info();\n    console.log('Database info:', info);\n\n  } catch (err) {\n    console.error('Error:', err);\n  } finally {\n    // Clean up: destroy the database when done\n    await db.destroy();\n    console.log('Database destroyed.');\n  }\n}\n\nrunExample();\n","lang":"typescript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}