Export multiple frames to file system with exportAsync()

I understand how to use exportAsync() to create a Uint8Array that I can send back to ui.html to trigger a single download.

Does someone have an example of exporting multiple frames? The behavior would be the same as exporting multiple frames within the Figma app.

I’m currently working on a plugin for exporting a whole bunch of images once. I use jsZip for creating a zip file with all the images in there in the correct file structure. This way you end up with 1 single file you could trigger to download