class S3Adapter
implements PresignableAdapter

Adapter for AWS S3 and compatible services (Minio, LocalStack, etc.).

Constructors

S3Adapter(
client: S3Client,
bucket: string,
prefix: string
)

Methods

close(): Promise<void>
delete(key: string): Promise<void>

Deletes an object from S3. This operation is idempotent; it returns successfully even if the object does not exist.

get(key: string): Promise<StorageObject>
head(key: string): Promise<StorageMetadata>
list(prefix?: string): AsyncIterable<StorageEntry>
presign(
key: string,
options: PresignOptions
): Promise<string>
put(
key: string,
body: BodyInput,
options?: PutOptions
): Promise<void>

Usage

import { S3Adapter } from ".";