3.7 KiB
3.7 KiB
@suaveplan/storage-s3 - S3-compatible object storage adapter for @suaveplan/storage: implements AbstractStorage backed by @aws-sdk/client-s3 with presigned URLs, multipart upload, retry integration, and OTel instrumentation.
Summary
S3-compatible object storage adapter for @suaveplan/storage. Extends AbstractStorage backed by @aws-sdk/client-s3 with presigned URL generation, multipart upload, retry integration, and OpenTelemetry instrumentation.
Documentation tree
- registry — (no submodules)
- registry — (no submodules)
- s3 — (no submodules)
- s3 — (no submodules)
- utils — (no submodules)
- credential-validator — (no submodules)
Installation
bun add @suaveplan/storage-s3
Quick Start
import { createS3 } from "@suaveplan/storage-s3";
const storage = createS3({
bucket: "my-bucket",
region: "us-east-1",
accessKeyId: "AKIAIOSFODNN7EXAMPLE",
secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
});
await storage.set("hello.txt", new TextEncoder().encode("hello"));
const data = await storage.get("hello.txt");
Modules
src/s3/s3/s3—S3class andcreateS3factorysrc/types/s3.types—S3Options,PresignOptions,MultipartUploadOptions,S3ClientFactorysrc/utils/credential-validator—isAwsS3,validateCredentialssrc/registry/registry/registry—registerS3Provider