title: How do I extract data from a .tar.gz file (stored in the cloud) from a browser
body: <p><strong>Problem</strong></p>
  <p>I am making a single page application that will be storing its data in one of the major cloud provider's blob storage (for example goggle cloud storage). The data in the cloud storage is a .tar.gz file, and I want to access this from a browser app .</p>
  <p>Inside the tar file there will be hundreds of files, and I just want to get one of these files and render it into HTML. I can already load the file, it's just 'how do I get the data out of it'.</p>
  <p>Unsurprisingly I am currently using typescript/javascript in the single page application, but that could change if the answer was 'do it this way'.</p>
  <p>I'm not worried about browser compatibility (I can specify things like 'only works in this browser), but the browser doesn't have access to a file system and I can't 'shell out' to the operating system</p>
  <p><strong>What I have tried</strong></p>
  <p>I've had a look for npm packages, and the closest I've come to is  <a href="https://github.com/npm/node-tar" rel="nofollow noreferrer">https://github.com/npm/node-tar</a> (but that seems to need a file system). I am reasonably confident working with streams, but it doesn't feel (after reviewing the documentation) that zlib will do what I want 'out of the box'. I didn't get a lot of hits from google searching: most just gave the same advice I would: 'shell out to the operating system and have that do it with tar', but I can't follow that advice in the browser</p>
  <p><strong>My alternative</strong></p>
  <p>If this doesn't work I will put a lambda/function in place to do the de-tarring. I like avoiding 'more moving parts' if I can in a project, but this might be needed.</p>