How to use the builder-util-runtime/out/differentialUpdate/localZip.openZip function in builder-util-runtime

To help you get started, we’ve selected a few builder-util-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron-userland / electron-builder / packages / electron-builder / src / targets / blockMap.ts View on Github external
export async function computeBlockMap(archiveFile: string, compressionMethod: "lzma", compressionLevel: 9 | 1): Promise {
  const zip = await openZip(archiveFile)
  try {
    const entries = await zip.readEntries()
    const files = await BluebirdPromise.map(entries, async entry => {
      const blocks = await computeBlocks(zip.fd, entry.dataStart, entry.dataStart + entry.compressedSize)
      return {
        name: (entry.fileName as string).replace(/\\/g, "/"),
        size: entry.compressedSize,
        blocks,
      }
    }, {concurrency: 8})
    return {
      blockSize: 64,
      hashMethod: "md5",
      compressionMethod,
      compressionLevel,
      files,