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

x/earthstar/src/replica/attachment_drivers/filesystem.node.ts>AttachmentDriverFilesystem

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
class AttachmentDriverFilesystem
import { AttachmentDriverFilesystem } from "https://deno.land/x/earthstar@v10.0.0-alpha.4/src/replica/attachment_drivers/filesystem.node.ts";

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

Constructors

new
AttachmentDriverFilesystem(path: string)

Properties

private
closed: boolean
private
path: string

Methods

private
ensurePath(...args: string[])
close(erase: boolean): Promise<void>
erase(formatName: string, attachmentHash: string)
filter(attachments: Record<string, Set<string>>): Promise<{ format: string; hash: string; }[]>
getAttachment(formatName: string, attachmentHash: string): Promise<DocAttachment | undefined>
isClosed(): boolean
stage(formatName: string, attachment: ReadableStream<Uint8Array> | Uint8Array)