Simple .zip file generation with JavaScript using JSZip
The zipTree
function exported from this module takes a file tree object and creates a zip object from it using JSZip (which you need to install first via npm install jszip
):
// A tree is just a collection of file names mapped to their contents
let data = {
// Use a string for text content
'file.txt': '...file content...',