interface
ZipArchiveOptions
interface ZipArchiveOptions
Options for a zip archive.
// Each file is deflated
new Bun.Archive(data, { format: "zip" });
// No compression
new Bun.Archive(data, { format: "zip", compress: "store" });- compress?: 'zstd' | 'deflate' | 'store'
Compression algorithm to apply to each file.
"store"means no compression. A file of up to 1 MiB that would not get smaller is always stored.Every zip tool reads
"deflate"and"store". Many do not read"zstd".The constructor throws if you set this option for existing archive data.
- format: 'zip'
The format of the archive to create from an object.
Bun detects the format of existing archive data. If you set this option anyway, every method rejects when the data is not in that format. Bun does not convert between formats.
- level?: number
Compression level. The lowest is fastest, and the highest gives the best ratio.
"deflate": 1-12, and 6 by default"zstd": 1-22, and 3 by default"store": no effect