new Downloader(options)
Creates a new Downloader instance.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Configuration object. Properties
|
- Source
Methods
(async) downloadFile(url)
Downloads and saves a single file.
| Name | Type | Description |
|---|---|---|
url | Resource URL to download. |
- Source
emit(event, …args)
[override description]
| Name | Type | Attributes | Description |
|---|---|---|---|
event | string | | event to emit | |
args | <repeatable> | evemt arguments |
- Source
event success or failed as boolen
generateSummary()
Generates a structured summary of the download operation.
- Source
- DownloadSummary
handleError(url, error)
Handles and aggregates download errors.
| Name | Type | Description |
|---|---|---|
url | URL that caused the error. | |
error | The thrown error. |
- Source
(async) processQueue()
Processes all queued URLs using controlled concurrency.
- Source
Promise<PromiseSettledResult
(async) startDownload() → {Promise.<DownloadSummary>}
Initiates the download lifecycle.
- Source
- DownloadSummary
- Type:
- Promise.<DownloadSummary>
