Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AzureStorageClient

An async Azure Storage client.

Hierarchy

  • AzureStorageClient

Index

Constructors

constructor

Properties

Optional Readonly options

Methods

createBlobReadStream

  • createBlobReadStream(path: string): Promise<Readable>
  • Creates a read stream for a blob.

    Parameters

    • path: string

      The path of the blob.

    Returns Promise<Readable>

    The promise with the stream.

createBlobService

  • createBlobService(): Promise<azureStorage.BlobService>
  • Creates a new blob service instance, based on the underlying options.

    Returns Promise<azureStorage.BlobService>

    The promise with the new instance.

getBlobInfo

  • getBlobInfo(path: string): Promise<false | BlobResult>
  • Tries to return information about a blob.

    Parameters

    • path: string

      The path / name of the blob to check.

    Returns Promise<false | BlobResult>

    The promise that contains the blob information or (false) if it does not exist.

Private getContainer

  • getContainer(): Promise<string>

listBlobs

  • listBlobs(path: string): Promise<BlobResult[]>
  • Lists a folder in a blob storage container.

    Parameters

    • path: string

      The path of the folder.

    Returns Promise<BlobResult[]>

    The promise with the result.

loadBlob

  • loadBlob(path: string): Promise<Buffer>
  • Loads a blob.

    Parameters

    • path: string

      The path / blob name.

    Returns Promise<Buffer>

    The promises with the loaded data.

saveBlob

  • saveBlob(path: string, data: any): Promise<void>
  • Saves / uploads a blob.

    Parameters

    • path: string

      The path / name of the blob.

    • data: any

      The data to upload / store.

    Returns Promise<void>

saveUniqueBlob

  • saveUniqueBlob(path: string, data: any): Promise<string>
  • Saves a blob with a unique name / path.

    Parameters

    • path: string

      The original path / name of the blob.

    • data: any

      The data to store / save.

    Returns Promise<string>

    The promise with the path / name of the stored blob.

Private toFullPath

  • toFullPath(p: string): Promise<string>

Static fromEnvironment

Generated using TypeDoc