happy-opfs
    Preparing search index...

    Function zipStreamFromUrl

    • Zip a remote file using streaming compression.

      This function downloads and compresses the file in a streaming manner, minimizing memory usage. Recommended for large remote files. For small files, consider using zipFromUrl instead.

      Use fflate as the zip backend.

      This API is built on @happy-ts/fetch-t for downloading the source. requestInit supports timeout, onProgress, and filename via ZipFromUrlRequestInit.

      Parameters

      • sourceUrl: string | URL

        The url to be zipped.

      • zipFilePath: string

        The path to the zip file.

      • OptionalrequestInit: ZipFromUrlRequestInit

        Optional request initialization parameters.

      Returns AsyncVoidIOResult

      A promise that resolves to an AsyncIOResult indicating whether the source was successfully zipped.

      2.0.0

      // Stream zip a large remote file
      (await zipStreamFromUrl('https://example.com/large-file.bin', '/backups/file.zip'))
      .inspect(() => console.log('Remote file zipped successfully'));