mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
12 lines
313 B
TypeScript
12 lines
313 B
TypeScript
import got, { CancelableRequest } from "got";
|
|
|
|
export interface DownloadFileOptions {
|
|
url: string;
|
|
gzip?: boolean;
|
|
timeout?: number;
|
|
}
|
|
|
|
export function downloadFile({ url, timeout, gzip = true }: DownloadFileOptions): CancelableRequest<Buffer> {
|
|
return got(url, { timeout, decompress: gzip }).buffer();
|
|
}
|