new Downloader(options)
Creates a new Downloader instance.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Configuration object. Properties
|
- Source
Methods
(async) downloadFile(url)
Downloads and saves a single file.
Parameters:
| Name | Type | Description |
|---|---|---|
url | Resource URL to download. |
- Source
Returns:
generateSummary()
Generates a structured summary of the download operation.
- Source
Returns:
- DownloadSummary
handleError(url, error)
Handles and aggregates download errors.
Parameters:
| Name | Type | Description |
|---|---|---|
url | URL that caused the error. | |
error | The thrown error. |
- Source
(async) processQueue()
Processes all queued URLs using controlled concurrency.
- Source
Returns:
- Promise<any | unknow>
(async) startDownload() → {Promise.<DownloadSummary>}
Initiates the download lifecycle.
- Source
Returns:
- DownloadSummary
- Type:
- Promise.<DownloadSummary>
