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.
18 lines (17 loc) • 476 B
TypeScript
export interface Task {
id: string;
priority: number;
action: () => Promise<boolean>;
retries: number;
consoleLog?: boolean;
}
export type DownloadManagerOptions = {
method?: "simple" | "queue";
concurrencyLimit?: number;
retries?: number;
consoleLog?: boolean;
downloadFolder?: string;
getFileName?: (url: string) => string;
otherTaskFunction?: (url: string, fileName: string) => Promise<void>;
overWriteFile?: boolean;
};