happy-opfs
    Preparing search index...

    Function zipFromUrl

    • Zip a remote file and write to a zip file.

      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.

      1.7.0

      // Zip a remote file to a local zip file
      (await zipFromUrl('https://example.com/file.txt', '/backups/file.zip'))
      .inspect(() => console.log('Remote file zipped successfully'));
    • Zip a remote file and return the zip file data.

      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.

      • OptionalrequestInit: ZipFromUrlRequestInit

        Optional request initialization parameters.

      Returns AsyncIOResult<Uint8Array<ArrayBuffer>>

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

      1.7.0

      // Zip a remote file and get the data
      (await zipFromUrl('https://example.com/file.txt'))
      .inspect(zipData => console.log(`Zip size: ${ zipData.byteLength } bytes`));