Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/src/sync-fs/sync-fs.ts>syncReplicaAndFsDir

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
function syncReplicaAndFsDir
import { syncReplicaAndFsDir } from "https://deno.land/x/earthstar@v10.0.0/src/sync-fs/sync-fs.ts";

Syncs an earthstar replica with a directory on the filesystem, representing Earthstar documents as files and vice versa. Make sure you understand the changes this function could enact upon a given directory before using it, as it can delete files in certain circumstances.

  • Changes from the filesystem which are superseded by writes from the replica will still be synced to the replica as an older version of the document, provided they were authored by different identities.
  • If a file has a path containing a ! (i.e. an ephemeral path), it will be deleted unless a correspending document is found in the replica.