code: async function archiveWorkingDir(dirPath, archive) {
    // recursively collect all entries (files and directories)
    const allEntries = await collectFSEntries(dirPath, []);
  
    const process = (entry, cb) => {
      const p = relativePaths(dirPath, entry.path);
      if (p.length) {
        if (entry.stats.isDirectory()) {
          archive.append(null, { name: `${p}/` });
        } else {
          archive.append(fse.createReadStream(entry.path), { name: p });
        }
      }
      cb();
    };
  
    return new Promise((resolve, reject) => {
      async.eachSeries(
        allEntries,
        process,
        (err) => {
          if (err) {
            reject(err);
          } else {
            resolve(archive);
          }
        },
      );
    });
  }
docs: Serializes the specified git working directory as an archive (zip/tgz).
  
  @param {string} dirPath working directory
  @param {object} archiver Archiver instance
  @returns {Promise<stream.Readable>} readable stream of archive