Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Downloader

A file downloader.

Hierarchy

  • Downloader

Index

Constructors

Accessors

  • get currentFile(): number
  • The number of the current downloading file.

    Returns number

  • get progress(): number
  • get rootPath(): null | string
  • get totalFiles(): number
  • Total amount of files at the start of downloading.

    Returns number

Methods

  • addMultipleEntries(inputs: (string | number | DownloadEntry)[]): number
  • Adds multiple entries to the downloader's queue.

    Parameters

    • inputs: (string | number | DownloadEntry)[]

      The entries to be added.

    Returns number

    The number of entries in the queue.

  • Adds a single entry to the downloader's queue.

    Parameters

    Returns number

    The number of entries in the queue.

  • Downloads every file from the queue. By default it saves all files on a disk and resulting buffer will be null. If file is already exists or failed to write the buffer will also be null.

    Returns Promise<DownloadResult[]>

    Download results.

  • Downloads a single file from the queue with expected rate limit. By default it saves all files on a disk and resulting buffer will be null. If file is already exists or failed to write the buffer will also be null.

    Returns Promise<DownloadResult>

    Download result.

  • reset(): void