A quick article on how to generate a zip file (in memory) in the browser using javascript and trigger a download. It is a pretty straight forward process.
Create .zip files using JavaScript. Provides a simple API to place any content generated by JavaScript into a .zip file for your users. How to use JSZip · API · FAQ · Limitations