Skip to main content
Module

x/earthstar/src/entries/npm.ts>DocDriverLocalStorage

Storage for private, distributed, offline-first applications.
Go to Latest
class DocDriverLocalStorage
import { DocDriverLocalStorage } from "https://deno.land/x/earthstar@v10.0.2/src/entries/npm.ts";

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>