UNPKG

@guoyunhe/downloader

Version:

Download large files with minimum RAM usage. Support tar.gz and zip extraction.

34 lines (31 loc) 839 B
export declare function download( /** File download URL. Must be public and support GET method. */ url: string, /** Output file (not extract) or folder (extract) path. */ dist: string, /** Extra download options. */ options?: DownloadOptions): Promise<void>; export declare interface DownloadOptions { /** * Maximum redirect times. * * @default 5 */ maxRedirects?: number; /** * Extract *.tar.gz archives * * @default false */ extract?: boolean; /** * Strip given number of leading components from file names before extraction. * * For example, if archive `archive.tar' contained `some/file/name', then `strip: 2` would extract * this file to file `name`. * * @default 0 */ strip?: number; } export { }