happy-opfs
    Preparing search index...

    Function unzipStreamFromUrl

    • Unzip a remote zip file to a directory using streaming decompression. Equivalent to unzip -o <zipFilePath> -d <destDir>

      This function processes the zip file incrementally, minimizing memory usage. Recommended for large files (>10MB). For small files, consider using unzipFromUrl instead.

      Use fflate as the unzip backend.

      This API is built on @happy-ts/fetch-t for downloading the zip file. options supports timeout and onProgress options.

      Parameters

      • zipFileUrl: string | URL

        Zip file url.

      • destDir: string

        The directory to unzip to.

      • OptionalrequestInit: FsRequestInit

        Optional request options.

      Returns AsyncVoidIOResult

      A promise that resolves to an AsyncIOResult indicating whether the zip file was successfully unzipped.

      2.0.0

      (await unzipStreamFromUrl('https://example.com/large-archive.zip', '/extracted'))
      .inspect(() => console.log('Remote zip file unzipped successfully'));

      // With timeout
      (await unzipStreamFromUrl('https://example.com/archive.zip', '/extracted', { timeout: 30000 }))
      .inspect(() => console.log('Remote zip file unzipped successfully'));