Documentation
    Preparing search index...

    Provides a localized file system storage backend. Perfect for development or single-node deployments using local disk volumes.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _alias: string = ''
    _client: any
    _params: StorageParameters = {}

    Methods

    • Parameters

      • file: FileType
      • size: number
      • workingDir: string
      • bucketDir: string
      • thumbnailExtension: string
      • imagePath: string

      Returns Promise<{ [key: string]: string }>

    • Parameters

      Returns { bucketDir: any; extension: any; name: any }

    • Parameters

      • workingDirName: string

      Returns Promise<string>

    • Copies a file from one storage path to another within the local disk.

      Parameters

      Returns Promise<any>

      A promise resolving to the new file footprint.

    • Writes a streaming data source directly to the local disk.

      Parameters

      • file: FileType

        File footprint detailing the target path.

      • stream: Readable

        Readable data stream.

      Returns Promise<FileType>

      A promise resolving to the saved FileType metadata.

    • Deletes a file from the local storage volume.

      Parameters

      Returns Promise<boolean>

      True if deleted, False if it didn't exist.

    • Downloads a stored file into a specific local directory (usually outside the storage pool).

      Parameters

      Returns Promise<any>

      A promise resolving to the downloaded file's path.

      If the file doesn't exist.

    • Extracts the first page of a document (e.g. PDF) via ImageMagick, resizes it, and uploads it as a thumbnail.

      Parameters

      • file: FileType

        Original document footprint.

      • sizes: number[]

        Array of desired thumbnail dimensions (px).

      Returns Promise<any>

      A mapping of generated thumbnail identifiers to their respective storage refs.

    • Downloads an image, generates resized thumbnails via sharp, and uploads them back.

      Parameters

      • file: FileType

        Original image footprint.

      • sizes: number[]

        Array of desired thumbnail dimensions (px).

      Returns Promise<any>

      A mapping of generated thumbnail identifiers to their respective storage refs.

    • Entry point for thumbnail generation. Analyzes the content type and automatically delegates to the appropriate generation strategy (Image, Video, or Document).

      Parameters

      • file: FileType

        Target file footprint.

      • sizes: number[]

        Desired dimensions.

      Returns Promise<any>

      The generated thumbnail map, or an empty object if unsupported/failed.

    • Extracts a single frame from a remote video via ffmpeg, resizes it, and uploads the frame as an image thumbnail.

      Parameters

      • file: FileType

        Original video footprint.

      • sizes: number[]

        Array of desired thumbnail dimensions (px).

      Returns Promise<any>

      A mapping of generated thumbnail identifiers to their respective storage refs.

    • Computes statistics for a given bucket.

      Parameters

      • Optionalbucket: string

        Target bucket name.

      • Optionalprefix: string

        Optional directory prefix.

      Returns Promise<BucketStatsType>

      A promise resolving to bucket statistics.

    • Provides direct access to the underlying fs-extra driver.

      Returns any

      The fs module wrapper.

    • Retrieves basic filesystem metadata (like file size) for the specified file.

      Parameters

      • file: FileType

        The target file reference.

      Returns Promise<FileType>

      A promise resolving to the file object augmented with its actual byte size.

    • Initializes a Node.js Readable stream from the disk file.

      Parameters

      Returns Promise<Readable>

      A promise resolving to the ReadStream.

    • Bypasses standard web upload links by returning a local URI for manual OS placement.

      Parameters

      • filePath: FileType

        The target file.

      • OptionalexpiresIn: number

        Ignored.

      Returns Promise<any>

      A promise resolving to the file URI string.

    • Generates a local file:// URI protocol link for system interoperability.

      Parameters

      • file: FileType

        Target file.

      • OptionalexpiresIn: number

        Ignored for local files.

      • Optionalaction: string

        Ignored.

      • Optionalextra: any

        Ignored.

      Returns Promise<any>

      A promise resolving to the local file URI string.

    • Checks if the file is a video or audio stream based on its MIME type or file extension.

      Parameters

      Returns boolean

      True if the file represents a video or audio asset.

    • Moves a file from one storage path to another within the local disk.

      Parameters

      Returns Promise<any>

      A promise resolving to the relocated file footprint.

    • Creates a read stream and directly pipes it to an output (e.g. an HTTP response).

      Parameters

      • file: FileType

        File to stream.

      • res: any

        The writable destination pipe.

      Returns Promise<any>