code: function extractXPI(xpiPath) {
    return when.promise(function(resolve, reject) {
      if (!xpiPath) {
        reject(new Error("xpiPath cannot be empty"));
      }
      var stat = fs.statSync(xpiPath);
      if (!stat.isFile()) {
        reject(new Error("expected an XPI file, got: " + xpiPath));
      }
      tmp.dir(function(err, tmpPath, removeTmpDir) {
        function cleanUpAndReject(err) {
          removeTmpDir();
          reject(err);
        }
        if (err) {
          return cleanUpAndReject(err);
        }
  
        var unzipper = new DecompressZip(xpiPath);
        unzipper.on("extract", function(_log) {
          resolve({
            path: tmpPath,
            remove: removeTmpDir,
          });
        });
        unzipper.on("error", cleanUpAndReject);
        unzipper.extract({
          path: tmpPath,
        });
      }, {
        prefix: "tmp-extracted-xpi-",
        // This allows us to remove a non-empty tmp dir.
        unsafeCleanup: true,
      });
    });
  }
docs: Takes an `xpiPath` (e.g. filename.xpi), extracts it, and resolves
  the returned promise with an object to let you work with the
  temporary directory.
  
  The resolution object has the following attributes:
  - `path`: temporary directory path containing the XPI contents.
  - `remove()`: method that removes the temporary directory. You must
  call this explicitly when you are finished.
  
  @param {Object} tmpXPI
  @return {Promise}