async function writeJson(contents, path, gzip) {
  const writeStream = fs.createWriteStream(gzip ? path + '.gz' : path);
  if (gzip) {
    await stream.promises.pipeline(contents, createGzip(), writeStream);
  } else {
    await stream.promises.pipeline(contents, writeStream);
  }
}
@param {import('stream').PipelineSource<any>} contents
@param {string} path
@param {boolean} gzip