Hacker News new | ask | show | jobs
by simonw 28 days ago
I didn't know you could do this with fetch() and a data: URI:

  fetch('data:;base64,1ZpLsgIxCEXnrM...==').then(
    r => r.body.pipeThrough(new DecompressionStream('deflate-raw'))
  ).then(
    s => new Response(s).text()
  ).then(
    t => b.innerHTML = '<pre style=font-size:.65vw>' + t
  )
1 comments

u don't need the first .then: https://github.com/piwodlaiwo/smallest-world-map/pull/1

mine is shorter