Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

odk-sync

Experimental - use with caution, may not be supported in the future

synchronize odk data

api

var Sync = require('odk-sync')

var sync = Sync(opts)

Create a new odk sync instance.

  • opts.db - required leveldb instance
  • opts.log - required hyperlog instance

var stream = sync.replicate(opts, cb)

Create a duplex stream for replication.

When replication is finished cb(err) fires.

Optionally:

  • opts.live - when true, keep replication open

sync.importDevice(dir, cb)

Import a directory of odk data from the file system at dir.

sync.importFiles(files, cb)

Import an array of browser File objects file. You can use this method with drag-drop to drop an odk directory into a web page.

cb(err, docs) fires with an array of docs. Each doc in docs:

  • doc.files - an array of string keys for attached files
  • doc.info - odk form data

var stream = sync.list(opts, cb)

List odk records as a readable stream or collect the records as cb(null, docs). Each doc in docs has:

  • doc.files - an array of string keys for attached files
  • doc.info - odk form data

var geostream = sync.geojson(opts, cb)

List odk records as a stream of geojson data or collect a string of geojson as cb(err, str).

sync.read(key, cb)

Read all the documents under key as cb(err, streams).

About

Synchronize ODK data

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages