Builds a ZipWriterConstructorOptions.createTempStream factory that spills the data of buffered entries to the Origin Private File System (OPFS) instead of keeping it in memory.
An entry stays in memory until it exceeds thresholdBytes, then spills to a temporary OPFS file that is streamed back and deleted afterwards, so peak memory stays bounded on large buffered entries.
OPFS is a browser/worker feature; feature-detect navigator.storage.getDirectory (or pass getDirectory) before using it, and let the writer use its in-memory default elsewhere.
Builds a ZipWriterConstructorOptions.createTempStream factory that spills the data of buffered entries to the Origin Private File System (OPFS) instead of keeping it in memory.
An entry stays in memory until it exceeds
thresholdBytes, then spills to a temporary OPFS file that is streamed back and deleted afterwards, so peak memory stays bounded on large buffered entries.OPFS is a browser/worker feature; feature-detect
navigator.storage.getDirectory(or passgetDirectory) before using it, and let the writer use its in-memory default elsewhere.