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
Written by Sebastian Hoitz
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Download
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#