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

x/earthstar/src/entries/deno.ts

Storage for private, distributed, offline-first applications.
Go to Latest
import * as earthstar from "https://deno.land/x/earthstar@v10.2.0/src/entries/deno.ts";

Earthstar APIs which run in the Deno runtime.

Classes

An attachment driver which persists attachments using the local filesystem. Works with Deno.

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.

A server extension for populating a server with known shares. Use this to specify which shares you'd like your server to sync with others.

A server extension for exposing the contents of shares, so that you can request documents by their path and have them served over HTTP. Can be used to create wikis, websites, image galleries, and more.

A server extension which reads settings from a specified share, e.g. which shares to host on the server. Settings are modified by other peers syncing with this server.

An extension which enables synchronisation over the web via HTTP.

A syncing partner to be used with servers reachable via the internet. Works everywhere.

A replica driver which persists data to the filesystem.

An extensible Earthstar server able to synchronise with other peers.

The core server logic. Combine this with a HTTP framework to create a fully-fledged server.

Variables

A version of the ICryptoDriver interface backed a WASM wrapper of libsodium. Faster than noble by several magnitudes. Works in Deno.

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 file has a path containing a ! (i.e. an ephemeral path), it will be deleted unless a correspending document is found in the replica.

Interfaces

Implement this interface to create an Earthstar server extension.