Skip to main content
Module

x/earthstar_replica_server/deps.ts>Earthstar.DocDriverLocalStorage

An always-online Earthstar peer for your shares.
Latest
class Earthstar.DocDriverLocalStorage
import { Earthstar } from "https://deno.land/x/earthstar_replica_server@4.0.0-beta.1/deps.ts";
const { DocDriverLocalStorage } = Earthstar;

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.

Constructors

new
DocDriverLocalStorage(share: ShareAddress, key?: string)

Properties

_localStorageKeyConfig: string
_localStorageKeyDocs: string

Methods

_deleteConfigSync(key: string): boolean
_getConfigSync(key: string): string | undefined
_setConfigSync(key: string, value: string): void
close(erase: boolean)
deleteConfig(key: string): Promise<boolean>
getConfig(key: string): Promise<string | undefined>
listConfigKeys(): Promise<string[]>
setConfig(key: string, value: string): Promise<void>
upsert<FormatType extends string, DocType extends DocBase<FormatType>>(doc: DocType): Promise<DocType>