Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!