code: function writeZip(zip, targetPath) {
    const opts = {
      platform: process.platform == 'win32' ? 'DOS' : 'UNIX',
      compression: 'DEFLATE',
      compressionOptions: {
        level: 9
      }
    };
    return new BbPromise(resolve =>
      zip
        .generateNodeStream(opts)
        .pipe(fse.createWriteStream(targetPath))
        .on('finish', resolve)
    ).then(() => null);
  }
docs: Write zip contents to a file.
  @param {JSZip} zip the zip object
  @param {string} targetPath path to write the zip file to.
  @return {Promise} a promise resolving to null.