Skip to content

basalt / storage-s3/src / s3Disk

Function: s3Disk() ​

> s3Disk(options): object & DiskOptions

Defined in: storage-s3/src/index.ts:593

An S3 disk, ready to hand to storagePlugin({ disks }).

ts
storagePlugin({
  disks: {
    documents: s3Disk({ bucket: 'docs', region: 'eu-west-1' }),
    uploads: s3Disk({ bucket: 'up', endpoint: 'http://localhost:9000' }), // MinIO
  },
})

This is the shape @basaltkit/storage-azure and @basaltkit/storage-gcs already use — a driver instance, not a string. The { driver: 's3' } shorthand it replaces lived in the core, which meant every consumer installed the AWS SDK (4.4 MB) whether or not they used S3.

Parameters ​

options ​

S3DriverOptions & DiskOptions

Returns ​

object & DiskOptions

Released under the MIT License.