Skip to main content
Module

x/earthstar/src/entries/deno.ts

A specification and Javascript library for building online tools you can truly call your own.
Go to Latest
import * as earthstar from "https://deno.land/x/earthstar@v9.3.3/src/entries/deno.ts";

Classes

A replica driver which perists to LocalStorage, which stores a maximum of five megabytes per domain. If you're storing multiple shares, this limit will be divided among all their replicas. Works in browsers and Deno.

A strorage driver which persists to SQLite. Works in Deno and browsers.

Functions

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 document has a certain extension (e.g. .jpg, .mp3), the syncer assumes the contents are base64 encoded when writing data to the filesystem.
  • 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.