1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/common/utils/downloadFile.ts
Sebastian Malton 07b75b8027 fix changing to got
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2021-04-01 12:48:12 -04:00

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();
}