zipFile.stream(name[, options])


  • name <string>
  • options <Object>
    • verify <boolean> 验证条目的 CRC-32 校验和。默认值:true。
    • maxSize <number> 拒绝声明超过此数量未压缩字节的内容。**默认值:**无限制。
  • 返回:<Promise> 充满了成员的解压内容的 <stream.Readable>,无需将整个成员缓存在内存中。

方便的封装器,会解析为 Readable 在 zipFile.get()(name) 的 zipEntry.contentIterator() 上;压缩的字节会在读取流时从磁盘中获取。如果档案中没有名为 name 的条目,返回的 promise 会被 ERR_ZIP_ENTRY_NOT_FOUND 拒绝。

🌐 Convenience wrapper that resolves to a Readable over zipEntry.contentIterator() of zipFile.get()(name); the compressed bytes are read from disk as the stream is consumed. The returned promise rejects with ERR_ZIP_ENTRY_NOT_FOUND if the archive has no entry named name.