zipFile.compact([comment])
comment<string> 一个归档评论。默认:zipFile.comment。- 返回:<stream.Readable> 一条当前实时条目的流,被序列化成一个全新的档案,没有残留的
zipFile.addEntry()/zipFile.delete()调用留下的无用空间。
不会修改打开的文件;将结果传输到一个新文件中:
🌐 Does not modify the open file; pipe the result into a new one:
import { createWriteStream } from 'node:fs';
zip.compact().pipe(createWriteStream('compacted.zip'));