class StorageService
implements IStorage
Since 0.1.0

Storage service backed by a pluggable provider.

The committed IStorage.get throws when an object is absent; providers signal absence with null, and this service performs the null → throw conversion so the throw contract lives in one place.

Constructors

StorageService(provider: StorageProvider)
Parameters
provider: StorageProvider

The backing storage provider

Methods

delete(path: string): Promise<boolean>

Deletes an object.

exists(path: string): Promise<boolean>

Reports whether an object exists.

get(path: string): Promise<Uint8Array>

Retrieves an object.

getSignedUrl(
path: string,
): Promise<string>

Creates a time-limited URL granting direct access to an object.

getStream(path: string): Promise<ReadableStream<Uint8Array>>

Retrieves an object as a streaming body for zero-copy downloads.

Delegates to the provider's optional getStream; falls back to wrapping the buffered get result in a one-chunk ReadableStream when the provider lacks native streaming support.

put(
path: string,
data: Uint8Array,
): Promise<void>

Stores an object.

Usage

import { StorageService } from "storage-plugin/src/index.ts";