Bun S3

AWS S3 (and any S3-compatible bucket) via Bun's native Bun.S3Client instead of @aws-sdk/client-s3. Bun-only.

Installation

This adapter has no extra peer dependencies - the runtime (Node or Bun) provides everything it needs.

npm install files-sdk

AWS S3 (and any S3-compatible bucket) via Bun's native Bun.S3Client instead of @aws-sdk/client-s3. Bun-only: skip the AWS SDK and use the runtime's built-in primitive when you're already on Bun. The adapter is a thin wrapper around Bun.S3Client's file(), write(), stat(), list(), and presign().

Three things differ from files-sdk/s3: copy() streams bytes through your process because Bun doesn't expose a server-side CopyObject primitive; upload() throws on metadata and cacheControl because Bun.S3Client.write() has no equivalent options; and signedUploadUrl() throws on maxSize because Bun exposes presigned URLs only - not S3 POST policy fields. Reach for files-sdk/s3 on the same bucket when you need any of those.

import { Files } from "files-sdk";import { bunS3 } from "files-sdk/bun-s3";const files = new Files({  adapter: bunS3({    bucket: "uploads",    region: "us-east-1",    // accessKeyId / secretAccessKey auto-loaded by Bun from    // S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEY (or AWS_* equivalents)  }),});// Or hand it the singleton Bun.s3 client directly:new Files({ adapter: bunS3({ client: Bun.s3 }) });

Options