Interface IDownloadFilesOptions

Options for

See

downloadFiles

Hierarchy

  • IDownloadFilesOptions

Properties

defaultExt?: string

Default file extension to use if none is specified in the file object. If none is specified here either, the extension will be inferred from the url, if possible. If not possible, the extension will be '.unknown'.

emitter?: EventEmitter

Optionally pass an EventEmitter to receive events:

  • queue(PromiseQueue)
  • start({ url, filepath })
  • download({ url, filepath })
  • fail({ url, error })
  • done({ downloaded, failed })
  • error(error)

If emitter is passed, errors (not failed downlaods) are emitted instead of thrown.

files: {
    ext?: string;
    url: string;
}[]

The URLs and file-extensions of the files to download.

Type declaration

  • Optional ext?: string
  • url: string
noPrefix?: boolean

Whether to prefix the downloaded files with a zero-padded index. If the filename cannot be derived from the URO, the filename will be a timestamp integer.

outdir?: string

The output directory to download files to. Defaults to the user's OS 'Downloads' directory.

queue?: Omit<IFunAsyncRateLimitOptions, "throwOnTimeout" | "autoStart">

Options for the internal PromiseQueue.

wipe?: boolean

Whether to wipe the output directory before downloading. This option is ignored if outdir is not specified.

Generated using TypeDoc