Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oroce/couchdb-sync
https://github.com/oroce/couchdb-sync
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/oroce/couchdb-sync
- Owner: oroce
- Created: 2014-02-15T15:33:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-08T07:04:35.000Z (over 10 years ago)
- Last Synced: 2024-11-19T23:11:42.450Z (about 1 month ago)
- Language: JavaScript
- Size: 154 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# couchdb-sync
It's an ugly module, needs lot of a refactoring, i mainly ported @dominictarr's [level-couch-sync][lcs] to a general sync module.
I did this because I'm trying to replicate npmjs registry to riak.
# API
```js
var sync = require("couchdb-sync")("https://fullfatdb.npmjs.com/registry");
sync
.on( "data", function( doc ){
// doc is a couchdb doc
})
.on( "progress", function( progress ){
// progress of replication
})
.on( "fail", function( err ){
// ohhh uhhh npm is down?!:D
});
```It emits `data` and `progress` events, and you can even pause and resume syncing by calling `instance.feed.pause()` and `instance.feed.resume()` methods. (It can be useful if data comes too fast).
[lcs][https://github.com/dominictarr/level-couch-sync]