code: function readEntries (directoryReader, oldEntries, callback) {
    directoryReader.readEntries(
      (entries) => {
        const newEntries = [...oldEntries, ...entries]
        // According to the FileSystem API spec, readEntries() must be called until it calls the callback with an empty array.
        if (entries.length) {
          setTimeout(() => {
            readEntries(directoryReader, newEntries, callback)
          }, 0)
        // Done iterating this particular directory
        } else {
          callback(newEntries)
        }
      },
      // Make sure we resolve on error anyway
      () =>
        callback(oldEntries)
    )
  }
docs: Recursive function, calls the original callback() when the directory is entirely parsed. @param {function} callback - called with ([ all files and directories in that directoryReader ])