Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
How would I unzip a zip file in node

I would like to unzip a .zip file in node without any external libraries. How would i go about doing this?

I have tried using zlib but it returns incorrect header type

let zipfile = fs.readFileSync(fileinfomation.savelocation)   
zlib.gunzipSync(zipfile)

Edit I have also tried using

let zipfile = fs.readFileSync(fileinfomation.savelocation)   
zlib.unzipSync(zipfile)

And it returned i caused the following error Uncaught Error Error: incorrect header check

Link to zip https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-archive

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

zlib does not appear to support decompressing a whole zip file archive (that contains multiple files) which is what your visual studio zip file is.

You will either have to use a different library that does support decompressing zip archive files (there are many different libraries on NPM that support that) or you can use child_process to run a zip decompressor that is already on your system.

If this is windows, you can run (using child_process) the built in tar.exe that can decompress zip archive files or you can get your own command-line decompressor (I use 7-zip myself) and run it as a child_process.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda