title: How can I unzip a gzipped file in the browser?
body: <p>So I am having trouble sending PBF files from the server to the client gzipped. Everything else is gzipped except those files and I can't understand why. So I have decided to gzip the files before hand and I want to unzip them in the browser. </p>
  
  <p>Here is where I will receive the gzipped file:</p>
  
  <pre><code>var soil = L.mbTiles("data/myLayer/{z}/{x}/{y}.pbf.gz", {
      name: "myLayer",
      storage: "myLayer",
      mbtileLayerName: "myLayer",
      maxNativeZoom: 10,
      minNativeZoom: 10,
      minZoom: 6,
      bounds: L.latLngBounds([36.9,-116.2],[35.0,-113.9])
  })
  </code></pre>
  
  <p>Now I will modify mbTiles and I want to unzip it before it does anything with that data. How do I do this?</p>
  
  <p><strong>EDIT</strong>
  Here is my server.js: </p>
  
  <pre><code>var loopback = require('loopback');
  var boot = require('loopback-boot');
  var compression = require('compression');
  var bodyParser = require('body-parser');
  var app = module.exports = loopback();
  var session = require('client-sessions');
  var path = require('path');
  var expressStaticGzip = require("express-static-gzip");
  app.engine('pug', require('pug').__express);
  app.set('views', path.join(__dirname, '../views'));
  app.set('view engine', 'pug');
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({extended: true}));
  app.use(compression({ threshold: 0 }));
  app.use(loopback.static(__dirname+'../'));
  //app.use("/test/data", expressStaticGzip("../views/test/data"));
  
  app.start = function() {
    // start the web server
    return app.listen(function() {
      app.emit('started');
      var baseUrl = app.get('url').replace(/\/$/, '');
      console.log('Web server listening at: %s', baseUrl);
      if (app.get('loopback-component-explorer')) {
        var explorerPath = app.get('loopback-component-explorer').mountPath;
        console.log('Browse your REST API at %s%s', baseUrl, explorerPath);
      }
    });
  };
  
  boot(app, __dirname, function(err) {
    if (err) throw err;
  
    // start the server if `$ node server.js`
    if (require.main === module)
      app.start();
  });
  </code></pre>