code: async function collectFSEntries(dirPath, allEntries) {
    // apply .gitignore rules
    const ignore = Ignore();
    const ignoreFilePath = joinPaths(dirPath, '.gitignore');
    if (await fse.pathExists(ignoreFilePath)) {
      const data = await fse.readFile(ignoreFilePath);
      ignore.add(data.toString());
    }
    ignore.add('.git');
  
    const filterIgnored = item => !ignore.ignores(relativePaths(dirPath, item));
  
    return new Promise((resolve, reject) => {
      klaw(dirPath, { filter: filterIgnored })
        .on('readable', function onAvail() {
          let item = this.read();
          while (item) {
            allEntries.push(item);
            item = this.read();
          }
        })
        .on('error', err => reject(err))
        .on('end', () => resolve(allEntries));
    });
  }
docs: Recursively collects all directory entries (files and directories).
  
  @param {string} dirPath directory path
  @param {Array<{{path: string, stats: fs.Stats}}>} allEntries array where entries will be added
  @returns {Promise<Array<{{path: string, stats: fs.Stats}}>>} collected entries