Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda