Storage interface returned by the Storage()
function.
Properties:
Methods:
config: Config
See: Config
copy: CopyFunction
exists: ExistsFunction
list: ListFunction
presign: PreSignFunction
read: ReadFunction
remove: RemoveFunction
stat: StatFunction
write: WriteFunction
Recursively copies the contents from source to destination.
See: CopyFunction
Checks if a file exists.
See: ExistsFunction
Reads the contents of a directory.
See: ListFunction
Creates a presigned URL that allows public access to the file.
See: PreSignFunction
Reads the contents of a file.
See: ReadFunction
Removes the file.
See: RemoveFunction
Returns the file information.
See: StatFunction
Writes data to a file, replacing the file if it already exists.
See: WriteFunction
import S3 from '@aws-sdk/client-s3'
import S3Presign from '@aws-sdk/s3-request-presigner'
const config = {
type: 's3',
path: 'bucket-3d8e8dd/path/to/data'
}
const dependencies = {
client: S3,
clientPresign: S3Presign,
clientInstance: new S3.S3Client({ region: 'eu-central-1' })
}
const storage = Storage(config, dependencies)