Skip to content

Latest commit

 

History

History
143 lines (66 loc) · 1.8 KB

StorageInterface.md

File metadata and controls

143 lines (66 loc) · 1.8 KB

StorageInterface

Storage interface returned by the Storage() function.

Index

Properties:

Methods:

Properties

  • config: Config

config: Config

See: Config

Methods

  • copy: CopyFunction
  • exists: ExistsFunction
  • list: ListFunction
  • presign: PreSignFunction
  • read: ReadFunction
  • remove: RemoveFunction
  • stat: StatFunction
  • write: WriteFunction

copy: CopyFunction

Recursively copies the contents from source to destination.

See: CopyFunction

exists: ExistsFunction

Checks if a file exists.

See: ExistsFunction

list: ListFunction

Reads the contents of a directory.

See: ListFunction

presign: PreSignFunction

Creates a presigned URL that allows public access to the file.

See: PreSignFunction

read: ReadFunction

Reads the contents of a file.

See: ReadFunction

remove: RemoveFunction

Removes the file.

See: RemoveFunction

stat: StatFunction

Returns the file information.

See: StatFunction

write: WriteFunction

Writes data to a file, replacing the file if it already exists.

See: WriteFunction

Examples

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)