Node downloads the compressed package, and the compressed package is destroyed after downloading

download a compressed package with dozens of js files with a size of about 2m.

found that the size is only 300k after downloading, and decompression found that it has been damaged

related codes

/ / Please paste the code text below (do not replace the code with pictures)

const downLoad = () => {
  const stream = fs.createWriteStream("./downLoad/abc.zip");
  request("https://xxxxx.com/downLoad/abc.zip").pipe(stream).on("close", () => {
    const unzip = new adm_zip("./downLoad/abc.zip");
    unzip.extractAllTo("./downLoad", /*overwrite*/true);
  });
}

is it because it"s too big

May.08,2022

Uh. It should be a matter of resources. It seems that you must log in if you download something more than 1m on the cloud, so each download will be limited. It would be better to change the location of the resource

.
Menu