Class StorageDriver<C, D>Abstract

Type Parameters

  • C = any
  • D = any

Hierarchy (view full)

Constructors

Properties

config: C

Methods

  • Returns the file contents as a string.

    Parameters

    • location: string
    • Optional encoding: string

    Returns Promise<string>

  • Returns url for a given key. Note this method doesn't validates the existence of file or it's visibility status.

    Parameters

    • location: string

    Returns string

  • Prepends content to a file.

    WARNING: It's pretty inefficient as it copies the file to a temp file and then back to the original file. Try to avoid using this method at least for large files.

    Parameters

    • location: string
    • content: string | Buffer

    Returns Promise<Response>