Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

siuying/pouchdb-replication-folder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PouchDB Replication with Folder

Safely replicate PouchDB/CouchDB with multiple clients, using a shared folder.

Usage

Assume you have a database want to sync to ~/Dropbox/Apps/MyApp/Database

var dbId = 'myDb'
var userId = UUID.v4()
var db1 = new PouchDB(dbId)
db1.replicateFolder(dropboxAppPath, dbId, userId).then((res) => {
     // on update
}).catch((error) => {
     // error occurred
})

on another computer, run the same code using a same dbID and different userID, and two databases should sync.

About

Replicate PouchDB/CouchDB database with a shared folder (e.g. Dropbox, iCloud Drive ...etc)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published