{"id":13630969,"url":"https://github.com/gr2m/spawn-pouchdb-server","last_synced_at":"2025-06-14T20:04:35.580Z","repository":{"id":35742534,"uuid":"40021450","full_name":"gr2m/spawn-pouchdb-server","owner":"gr2m","description":"Configurable per-app pouchdb-server as a drop-in replacement for CouchDB","archived":false,"fork":false,"pushed_at":"2021-03-05T06:49:21.000Z","size":45,"stargazers_count":27,"open_issues_count":1,"forks_count":13,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-04-22T13:23:45.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-31T19:26:17.000Z","updated_at":"2024-03-21T18:28:51.000Z","dependencies_parsed_at":"2022-08-18T06:29:28.591Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/spawn-pouchdb-server","commit_stats":null,"previous_names":["hoodiehq/spawn-pouchdb-server"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fspawn-pouchdb-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fspawn-pouchdb-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fspawn-pouchdb-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fspawn-pouchdb-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/spawn-pouchdb-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199090,"owners_count":21063641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:02:05.275Z","updated_at":"2025-04-21T16:32:12.321Z","avatar_url":"https://github.com/gr2m.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# spawn-pouchdb-server\n\n\u003e Configurable per-app pouchdb-server as a drop-in replacement for CouchDB\n\n[![NPM version](https://badge.fury.io/js/spawn-pouchdb-server.svg)](https://www.npmjs.com/package/spawn-pouchdb-server)\n[![Build Status](https://travis-ci.org/gr2m/spawn-pouchdb-server.svg?branch=master)](https://travis-ci.org/gr2m/spawn-pouchdb-server)\n[![Coverage Status](https://coveralls.io/repos/gr2m/spawn-pouchdb-server/badge.svg?branch=master)](https://coveralls.io/r/gr2m/spawn-pouchdb-server?branch=master)\n[![Dependency Status](https://david-dm.org/gr2m/spawn-pouchdb-server.svg)](https://david-dm.org/gr2m/spawn-pouchdb-server)\n\n## Motivation\n\n1. Simplify development setup\n\n   CouchDB is a fantastic database, but setting it up for local development is not easy, as it also\n   requires an Erlang runtime environment. Having a built-in PouchDB-Server in our apps will make\n   CouchDB optional.\n\n2. Isolated CouchDB configurations\n\n   Many Apps require couchdb users / admins / security settings etc. Using PouchDB makes it simple\n   to isolate these in local development. (But if you don't mind the CouchDB dependency,\n   you can also use [node-multicouch](https://github.com/gr2m/node-multicouch) for that).\n\n## Usage\n\n```js\n// npm install --save spawn-pouchdb-server\nvar spawnPouchdbServer = require('spawn-pouchdb-server')\n\nspawnPouchdbServer(function (error, server) {\n  console.log('PouchDB Server stared at localhost:5985/_utils')\n  server.stop(function () {\n    console.log('PouchDB Server stopped')\n  })\n})\n```\n\nFull example with all options (and default values)\n\n```js\n// npm install --save spawn-pouchdb-server\nvar spawnPouchdbServer = require('spawn-pouchdb-server')\n\nspawnPouchdbServer({\n  port: 5985,\n  directory: './.db',\n  backend: {\n    name: 'leveldown',\n    location: './.db'\n  },\n  log: {\n    file: './.db/pouch.log',\n    level: 'info'\n  },\n  config: {\n    file: './.db/config.json'\n  },\n  timeout: 10000, // in ms\n  verbose: false\n}, function (error, server) {\n  console.log('PouchDB Server stared at localhost:5985/_utils')\n})\n```\n\n## Options\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOption\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003edefault\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003cth\u003eport\u003c/th\u003e\n      \u003ctd\u003ePort number where CouchDB API will be exposed\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e5985\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003edirectory\u003c/th\u003e\n      \u003ctd\u003eDirectory where PouchDB server will store it's files. Also default location for file based levelup back-ends\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e5985\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003ebackend\u003c/th\u003e\n      \u003ctd\u003eEither an object with \u003ccode\u003ename\u003c/code\u003e and \u003ccode\u003elocation\u003c/code\u003e properties (see below), or \u003ccode\u003efalse\u003c/code\u003e for in-memory\u003c/td\u003e\n      \u003ctd\u003e\u003cem\u003esee below\u003c/em\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003ebackend.name\u003c/th\u003e\n      \u003ctd\u003enpm module name of \u003ca href=\"https://github.com/Level/levelup/wiki/Modules#storage-back-ends\"\u003elevelup storage back-end\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003cem\u003ebuilt in leveldown\u003c/em\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003ebackend.location\u003c/th\u003e\n      \u003ctd\u003eLocation option as passed to \u003ca href=\"https://github.com/Level/levelup#leveluplocation-options-callback\"\u003elevelup(location)\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"./.db\"\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003elog.file\u003c/th\u003e\n      \u003ctd\u003eLocation of log file. Set to \u003ccode\u003efalse\u003c/code\u003e to disable logging to a file. \u003ccode\u003elog.file\u003c/code\u003e is an alias for \u003ccode\u003econfig.log.file\u003c/code\u003e. Set to \u003ccode\u003efalse\u003c/code\u003e to not persist logs\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"./.db/pouch.log\"\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003elog.level\u003c/th\u003e\n      \u003ctd\u003eOne of \u003ccode\u003edebug\u003c/code\u003e, \u003ccode\u003einfo\u003c/code\u003e, \u003ccode\u003ewarning\u003c/code\u003e, \u003ccode\u003eerror\u003c/code\u003e, \u003ccode\u003enone\u003c/code\u003e. \u003ccode\u003elog.level\u003c/code\u003e is an alias for \u003ccode\u003econfig.log.level\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"info\"\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003econfig.file\u003c/th\u003e\n      \u003ctd\u003eLocation of CouchDB-esque config file. Set to \u003ccode\u003efalse\u003c/code\u003e to not persist configuration.\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e\"./.db/config.json\"\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003econfig.*\u003c/th\u003e\n      \u003ctd\u003eAll the \u003ca href=\"http://docs.couchdb.org/en/latest/config/index.html\"\u003eCouchDB Configuration\u003c/a\u003e, e.g. \u003ccode\u003econfig.admins = {\"adminuser\": \"adminpass\"}\u003c/code\u003e to fix \u003ca href=\"http://guide.couchdb.org/draft/security.html#party\"\u003eadmin party\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003etimeout\u003c/th\u003e\n      \u003ctd\u003eTime to connect to backend in milliseconds\u003c/td\u003e\n      \u003ctd\u003e10000\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003cth\u003everbose (true/false)\u003c/th\u003e\n      \u003ctd\u003eLog status information\u003c/td\u003e\n      \u003ctd\u003efalse\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Local setup \u0026 tests\n\n```bash\ngit clone git@github.com:gr2m/spawn-pouchdb-server.git\ncd spawn-pouchdb-server\nnpm install\nnpm test\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fspawn-pouchdb-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Fspawn-pouchdb-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fspawn-pouchdb-server/lists"}