UNPKG

bun-downloader-manager

Version:

bun-download-manager is a simple yet powerful package manager-like download manager built with Bun.js. It allows you to download files sequentially or with a queue-based approach, handling retries and concurrency limits efficiently.

20 lines (19 loc) 691 B
import type { DownloadManagerOptions } from "../types"; declare class DownloadManager { private readonly downloadQueue; private readonly concurrencyLimit; private readonly retries; private readonly method; private readonly downloadFolder; private readonly getFileName?; private readonly otherTaskFunction?; private readonly log; private readonly overWriteFile; constructor(options?: DownloadManagerOptions); private logger; private downloadFile; enqueueDownloadTask(url: string, fileName: string, priority?: number): void; private createFileName; download(urls: string | string[]): Promise<void>; } export default DownloadManager;