{"_id":"replimate","_rev":"27-6b640526289c2befb83035e2000626bc","name":"replimate","description":"CouchDB (using _replicator db) replication helpers","dist-tags":{"latest":"1.0.0"},"versions":{"0.2.0":{"name":"replimate","description":"CouchDB 1.1.0 (using _replicator db) replication helpers","tags":["couchdb","replication"],"author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"version":"0.2.0","engines":{"node":">= 0.4.x < 0.7.0"},"dependencies":{"async":"0.1.x","debug":"*","request":"2.2.x"},"devDependencies":{"nano":">= 0.9.5","async":">= 0.1.15"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"contributors":[],"_npmUser":{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"},"_id":"replimate@0.2.0","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"235b5a9487ca4c524e7c6163f1992719efa5bf0d","tarball":"https://registry.npmjs.org/replimate/-/replimate-0.2.0.tgz","integrity":"sha512-Fpuemf+IcHFMYwmdV3UGneJr8zdt0HcidXBqBEJBjBdDIKjAM6JxVQGbZAagxAJcoMgstttkAU/xilXchyuhEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBDRucecJz544LEWtm93ercStAL6aw/fsNbLCyUmxbdHAiEAwP/gDQQS0db7vCOevesPvDkmqR06C20kKubTX7/h/eo="}]},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}],"directories":{}},"0.2.1":{"name":"replimate","description":"CouchDB 1.1.0 (using _replicator db) replication helpers","tags":["couchdb","replication"],"author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"version":"0.2.1","engines":{"node":">= 0.4.x < 0.7.0"},"dependencies":{"async":"0.1.x","debug":"*","request":"2.9.x"},"devDependencies":{"nano":">= 0.9.5","async":">= 0.1.15"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"scripts":{"test":"mocha --reporter spec -t 10000"},"contributors":[],"_npmUser":{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"},"_id":"replimate@0.2.1","_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"b4fd6caffb10eceaaae6f64366400a3732e24eb6","tarball":"https://registry.npmjs.org/replimate/-/replimate-0.2.1.tgz","integrity":"sha512-GJZ8LLtHdTbfODuO6ploI/qYFo5UK7Zy5LKllg0k+sH/+C0liNqA3GPoFYGa79gZ4fQAByym0XptojDU9ie/Zg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDzTz0pxQnGHD6eHOf6pYmDwzmxTaZkMl2YaQhlqRnmfAiBeaXJqoabsYewwhZ/EpLn4s/GSzPTDx1joELSncYQfHQ=="}]},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.2.2":{"name":"replimate","description":"CouchDB 1.1.0 (using _replicator db) replication helpers","tags":["couchdb","replication"],"author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"version":"0.2.2","engines":{"node":">= 0.4.x < 0.9.0"},"dependencies":{"async":"0.1.x","debug":"*","request":"2.9.x"},"devDependencies":{"mocha":"1.2.x","nano":"3.0.x","async":"0.1.x"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"scripts":{"test":"mocha --reporter spec -t 10000"},"contributors":[],"_id":"replimate@0.2.2","dist":{"shasum":"51aab01d6de918a98dcdc04ffbdf1669f766bf5e","tarball":"https://registry.npmjs.org/replimate/-/replimate-0.2.2.tgz","integrity":"sha512-xHtd8poYxNfxfO8MqrMU3cZkoWrlrbmdd5PYgoHhTnQiUyB9eMByihzyVdK9IvAc39kWUlVJEKkk5YIxMJukMQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDa4MGbQ6HQamXTcirWV7eQ1VgrBQpjLxxgAzYEscSpUgIgGmTRV7byx2kCA9PPdTJx7z2iiWxTkGNq5Ej/l48beQI="}]},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.3.0":{"name":"replimate","description":"CouchDB (using _replicator db) replication helpers","tags":["couchdb","replication"],"author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"version":"0.3.0","dependencies":{"async":"0.2.x","debug":"*","request":"2.21.x"},"devDependencies":{"mocha":"1.12.x","nano":"4.1.x"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"scripts":{"test":"$(npm bin)/mocha --reporter spec -t 60s"},"_id":"replimate@0.3.0","dist":{"shasum":"ba4d25e75c16eff6d304419bdd064268f1112174","tarball":"https://registry.npmjs.org/replimate/-/replimate-0.3.0.tgz","integrity":"sha512-Z5eBH80g97zMxsYokMT82FHuB9wYJr/nQhnKAJR+msyBxtZyTgMmetH0mKNcWomUyX4u5LibNZ9LQ2iB4o447A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKj89vbfLGz1duIDz1b4MwfVJKdcUTpfJzwaaz1cb6UAiBFYAvjdAbMZmdWwIr5MLsX42HkVJrLqv/Ayp3Q93/ZGA=="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@gmail.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.5.0":{"name":"replimate","description":"CouchDB (using _replicator db) replication helpers","keywords":["couchdb","replication"],"author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"version":"0.5.0","dependencies":{"async":"0.2.x","debug":"*","request":"~2.27.0"},"devDependencies":{"mocha":"~1.13.0","nano":"4.1.x","out":"~0.5.1"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"scripts":{"test":"$(npm bin)/mocha --reporter spec -t 60s","gendocs":"gendocs > README.md"},"main":"index.js","directories":{"doc":"docs","example":"examples","test":"test"},"license":"MIT","_id":"replimate@0.5.0","dist":{"shasum":"6833a00f3779fccc1cf8fd0d462309f4f6607208","tarball":"https://registry.npmjs.org/replimate/-/replimate-0.5.0.tgz","integrity":"sha512-uW8QhXHB6rqlo9E3UFszTk6e7y4FfGOe2pM03TVM6bY/Vd1OPlnw+Mq61gdnPV/TckCcZscJwewrfgMoQyvinw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICd909/kfBlaIi5pcei/vsgDBA6EDg5XXbubs1NOGAz+AiEAofXlIeDNntSZq9p3x1lpJsfWK45h91qizx12Y7ZKNcA="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@gmail.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.5.2":{"name":"replimate","description":"CouchDB (using _replicator db) replication helpers","keywords":["couchdb","replication"],"author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"version":"0.5.2","dependencies":{"async":"0.2.x","debug":"*","request":"~2.27.0","cog":"~0.3.1"},"devDependencies":{"mocha":"~1.13.0","nano":"4.1.x","out":"~0.5.1"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"scripts":{"test":"$(npm bin)/mocha --reporter spec -t 60s","gendocs":"gendocs > README.md"},"main":"index.js","directories":{"doc":"docs","example":"examples","test":"test"},"license":"MIT","_id":"replimate@0.5.2","dist":{"shasum":"2bbdb796323f39f7a68155db7f4655e1bc10671d","tarball":"https://registry.npmjs.org/replimate/-/replimate-0.5.2.tgz","integrity":"sha512-R3L5qZQTZS1e2mFp0LuQPh2k7Kgczb1f2il+bewZEM0us0tMWkJlgXPBlmf1Zns0QQlXGLNhZAlxev34tdAUGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPdlW5x6ID8jQ7yaq9DFXToc7+rOMAeIOcX0Hmo9pC5AIhALuR/SZglwYVVPNu7ZcthV+L6FTDtpaELfeRh53hnqLA"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@gmail.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.5.3":{"name":"replimate","description":"CouchDB (using _replicator db) replication helpers","keywords":["couchdb","replication"],"author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"version":"0.5.3","dependencies":{"async":"0.2.x","debug":"*","request":"~2.27.0","cog":"~0.3.1"},"devDependencies":{"mocha":"~1.13.0","nano":"4.1.x","out":"~0.5.1"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"scripts":{"test":"$(npm bin)/mocha --reporter spec -t 60s","gendocs":"gendocs > README.md"},"main":"index.js","directories":{"doc":"docs","example":"examples","test":"test"},"license":"MIT","_id":"replimate@0.5.3","dist":{"shasum":"b23a8a400bf97826a46f00e46a505597d55bb988","tarball":"https://registry.npmjs.org/replimate/-/replimate-0.5.3.tgz","integrity":"sha512-rSDQ2RJpqC4O90iLIsEOE/RFeaZR6NVSVjsbnZYpDrrI7bv7QHX7/o4p6iy0PCUm5TGupZT3PmD6OW/uHaITvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF++iA6sXezDu/6dbC2sshYru4Upx21+8hkhFAB6BlW4AiEAnb7ms94yPKHRrcB7juYAJ7IMxojvT/r6v38GDOQ0K1s="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@gmail.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"1.0.0":{"name":"replimate","description":"CouchDB (using _replicator db) replication helpers","keywords":["couchdb","replication"],"author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"version":"1.0.0","dependencies":{"async":"^1.5.2","cog":"^1.1.0","debug":"^2.2.0","request":"^2.72.0"},"devDependencies":{"mocha":"^2.4.5","nano":"^6.2.0","out":"^1.0.0"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"scripts":{"test":"$(npm bin)/mocha --reporter spec -t 60s","gendocs":"gendocs > README.md"},"main":"index.js","directories":{"doc":"docs","example":"examples","test":"test"},"license":"MIT","gitHead":"1588492ed1594f9a587ce136ba1a2ea2bfd9fdda","homepage":"https://github.com/DamonOehlman/replimate#readme","_id":"replimate@1.0.0","_shasum":"b238b8f03ff6ff5eb8db394fe8157f7cda46eeb6","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@gmail.com"},"dist":{"shasum":"b238b8f03ff6ff5eb8db394fe8157f7cda46eeb6","tarball":"https://registry.npmjs.org/replimate/-/replimate-1.0.0.tgz","integrity":"sha512-NHSTWlB0WywZFhjy3EXH23mljFx9VhVXC6MwvWiY/RwrDlxbM0H0M7lfPR2uQF/cuUoh8JBX0DaUSN4tdG7I2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHrDjknXsRZDxHV3Zh5b1YseesfHsoAgv1rTDjTXZHuYAiB77sNbXbwBL9UBCYbK2jilTZ6C+jwagPG7PvX3uiYQNQ=="}]},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/replimate-1.0.0.tgz_1463708251121_0.8888932566624135"}}},"readme":"# replimate\n\nReplimate provides some helpers for working with the CouchDB 1.1\n(and above) `_replicator` database.  Using the `_replicator` database\nprovides some benefits over the traditional replication methods\nincluding replication persistence across CouchDB server restarts.\n\n\n[![NPM](https://nodei.co/npm/replimate.png)](https://nodei.co/npm/replimate/)\n\n[![Build Status](https://api.travis-ci.org/DamonOehlman/replimate.svg?branch=master)](https://travis-ci.org/DamonOehlman/replimate) \n\n## Example Usage\n\nWorking with replimate is designed to be really easy, and here are\na few examples:\n\n### Getting the Current _replicator DB docs\n\n```js\nvar replimate = require('replimate');\nvar targetUrl = process.env.COUCHDB_URL || 'http://localhost:5984';\nvar out = require('out');\n\nreplimate(dbUrl, function(err, docs) {\n  if (err) {\n    return out.error(err);\n  }\n\n  console.log(docs);\n});\n\n```\n\n### Creating a New Replication Job\n\nCreating a new replcication job is pretty easy also:\n\n```js\nvar replimate = require('replimate');\nvar targetUrl = process.env.COUCHDB_URL || 'http://localhost:5984';\nvar opts = {\n  action: 'replicate',\n  source: 'http://sidelab.iriscouch.com/seattle_neighbourhood',\n  target: 'seattle_neighbourhood'\n};\n\n// create a replication rule to run from the test seattle_neighbourhood db\n// to a local copy on the replimate instance\nreplimate(targetUrl, opts, function(err, monitor) {\n  console.log('replication started');\n\n  // using the returned monitor,\n  // report when the replication has finished\n  monitor.on('completed', function() {\n    console.log('replication finished');\n  });\n});\n\n```\n\nYou will note here, however, that we need to supply admin credentials to\ncreate a new replication job as the seattle_neighbourhood db will be need\nto be created on the replimate.iriscouch.com server.\n\n### Removing Completed Jobs\n\nOne thing that is interesting about the `_replicator` database is that it\ndoes start to fill up with replication jobs that have been completed in\nthe past.  In an effort to help keep my replicator database instances\nclear, the `clear-completed` job was created.\n\nLike creating new replication jobs, a user with admin privileges is\nrequired:\n\n```js\nvar replimate = require('replimate');\nvar targetUrl = process.env.COUCHDB_URL || 'http://localhost:5984';\nvar out = require('out');\n\nreplimate(targetUrl, { action: 'clear-completed' }, function(err) {\n  if (err) {\n    return out.error(err);\n  }\n\n  out('_replicator database now a little cleaner...');\n});\n```\n\n## Reference\n\n### replimate(targetUrl, opts?, callback)\n\nStart the replimate process.  The `targetUrl` specifies the target couch\nserver endpoint (including basic auth admin credentials if required).\n\nIf no `opts` are specified, then replimate will simply return information on\nthe entries within the `_replicator` database on that server.\n\n### Monitor\n\nThe replication Monitor class is returned from creating a replication task\nusing replimate. A Monitor provides a useful way to pass around an object that \ncan be used in other parts of your application to check on the status of a \nparticular replication job\n\n#### cancel(callback)\n\nCancel a replication task\n\n#### checkStatus(callback)\n\nRequest the status of the replication task.\n\n#### _checkState(stateName)\n\nThis is a simple helper function that will check the current state\nof the specified state name, and if already flagged trigger an event\nimmediately when a new event listener is coupled to the replication\nmonitor\n\n#### _monitorState(targetState, interval = 1000)\n\nMonitor the state of the replication job, and update data against\nthe monitor as it changes.\n\n### Replimate Core Actions\n\nReplimate implements a few core actions that can be invoked through the options\npassed to replimate\n\n#### info(targetUrl, opts, callback)\n\nThe `info` action is used to retrieve a list of all the current replication jobs for\nthe target servers `_replicator` database.  If no action is specified, then info is \nused by default\n\n#### replicate(targetUrl, opts, callback)\n\nThe `replicate` action is used to create a new replication task in the target\nserver's `_replicator` database.  For information on how the CouchDB _replicator\ndatabase operates, see the [CouchDB wiki](http://wiki.apache.org/couchdb/Replication#Replicator_database)\n\n## License(s)\n\n### MIT\n\nCopyright (c) 2016 Damon Oehlman <damon.oehlman@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}],"time":{"modified":"2022-06-26T11:22:57.270Z","created":"2011-12-04T03:41:47.742Z","0.1.0":"2011-12-04T03:41:51.904Z","0.1.1":"2011-12-04T05:56:08.161Z","0.2.0":"2011-12-30T05:46:11.970Z","0.2.1":"2012-03-03T03:51:51.776Z","0.2.2":"2012-06-27T07:28:43.233Z","0.3.0":"2013-08-08T12:18:45.079Z","0.5.0":"2013-10-29T00:34:26.495Z","0.5.2":"2013-10-29T06:16:52.523Z","0.5.3":"2013-10-29T10:00:55.705Z","1.0.0":"2016-05-20T01:37:35.976Z"},"author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/replimate.git"},"readmeFilename":"README.md","homepage":"https://github.com/DamonOehlman/replimate#readme","keywords":["couchdb","replication"],"bugs":{"url":"http://github.com/DamonOehlman/replimate/issues"},"license":"MIT"}