aws4fetch

This is a port of an Observable notebook by Tom Larkworthy [@tomlarkworthy] called aws4fetch. All mistakes and deviations from the original are my own.


~~~js
    import {AwsClient, AwsV4Signer} from '@tomlarkworthy/aws4fetch'
~~~

https://observablehq.com/@tomlarkworthy/aws4fetch

const aws4fetch = await (async () => {
  const response = await new Response(
    (
      await FileAttachment("aws4fetch.esm.js.gz").stream()
    ).pipeThrough(new DecompressionStream("gzip"))
  );

  const blob = await response.blob();
  const objectURL = URL.createObjectURL(
    new Blob([blob], { type: "application/javascript" })
  );

  try {
    return await import(objectURL);
  } finally {
    URL.revokeObjectURL(objectURL); // Ensure URL is revoked after import
  }
})();
display(aws4fetch)
const AwsClient = aws4fetch.AwsClient
const AwsV4Signer = aws4fetch.AwsV4Signer