0

As you can guess from the title, I am trying to write a small thing just for the sake of learning.

Here's my code in a Pastebin

As you can see, I am trying to grab a zipped repo from github, according to the express request's parameters, then serve it to the client. Originally I just piped the https response to the client's response, but the zipped archive has a top-level folder (as it comes from github) that I am trying to remove. I'm pretty new to this, and quite lost. Any advice on how do go about modifying the zip archive in memory?

Edit: I tried creating a separate archive, then iterating through each of the zipEntries and trying to add it to the new archive, and all of the files do end up on top, like I was aiming for, but they all appear as folders in winrar.

Here is the second attempt

Sergey Kalinichenko
  • 714,442
  • 84
  • 1,110
  • 1,523
noahtkeller
  • 165
  • 2
  • 8
  • if you fetch, extract, repack and send the zip per response, it will take a lot of time. instead you should serve the file statically. – user568109 Apr 02 '13 at 04:22
  • I understand that completely, but what I am attempting to do is as stated above. If I don't know how to do it, I would like to know how. – noahtkeller Apr 02 '13 at 14:33

0 Answers0