Is there an already-existing module for unzipping ZIP archive files using Luau? I’ve looked on Google but they’re all in vanilla Lua 5.x and require the zip library (the zip library is written in C and is >800 lines long, there’s no way I’m manually converting that much code to Lua).
This is for a new feature for a plugin (StudioCLI) that will use PromptImportFile.
The plugin unzips the imported ZIP archive and recreates the files all inside the plugin, not dependent on a webserver to receive the zip, parse it, and send back Lua-readable data (json)
There’s no way for Lua or Luau to access any functionality of the OS to manage files. As far as I’m aware, this would not be possible with Roblox without the use of that external web server. The best bet here is to make a feature request for APIs that help with handling ZIP Archives.
Take a look at the zzlib repository. It’s a pure Lua implementation. I haven’t ever used it (just found it), so I don’t know if/how it works, but might at least be a good starting point.
You will have to modify it a bit. For instance, in the main zzlib.lua file, it’s trying to dynamically load its core module based on the Lua version. Instead, just grab the inflate-bit32 module, since that’s what we have in Luau.
Also, I can only imagine that deflating in Lua is going to be pretty slow. Just FYI.