I have a file (or folder) in JSZip. I need to rename/move it.
const zip = new JSZip();
zip.file("file.txt", "File Content");
zip.rename("file.txt", "newname.txt"); // zip.rename doesn't exist
zip.rename doesn't exist, but is there any similar function? The only way that I can find is this answer, but it feels like it is too simple of a task to need that much code, and there might be a better way of doing it. If it matters, the code is running in a browser and not node.js.
I'm not sure how reliable this is, but this seems to work. It just deletes the old file and makes a new one.
It's still pretty big, but it's better in my opinion.