Last Updated: December 26, 2018
· sebastianhoitz

Node.JS on-the-fly streaming of zip files as download

Using this small class, you can create on-the-fly zip files, pipe multiple files into it while streaming the download to the client:

This provides multiple advantages:

  • No need to create the zip file first
  • Save hard disk space, since everything is immediately streamed
  • Better and more reactive user experience

This was inspired by: