gs61bw
Last Updated: February 25, 2016
·
5.496K
· sebastianhoitz
D6c0d78cf460c3213bb01bc2ab638294

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:

https://gist.github.com/4554903

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: http://blog.dump.ly/post/19819897856/why-node-js-streams-are-awesome

Say Thanks
Respond