async function downloadToMemory()

in hcapi.js [23:31]


async function downloadToMemory(url) {
  const auth = new GoogleAuth({
    scopes: "https://www.googleapis.com/auth/cloud-platform",
  });
  const client = await auth.getClient();
  const res = await client.request({ url, headers: { Accept: "application/dicom; transfer-syntax=*" }, responseType: "arraybuffer" });
  const buff = Buffer.from(res.data);
  return buff;
}