write = async function (filename, compress, result) {
  const content = JSON.stringify(result);

  const data = compress ? await gzip(content) : content;
  return await writeFile(filename + (compress ? ".gz" : ""), data);
}
Write contents into a compressed file.

@async
@params {String} filename
@params {Boolean} compress
@params {String} result