async function indexPack({
  fs,
  onProgress,
  dir,
  gitdir = join(dir, '.git'),
  filepath,
  cache = {},
}) {
  try {
    assertParameter('fs', fs)
    assertParameter('dir', dir)
    assertParameter('gitdir', dir)
    assertParameter('filepath', filepath)

    return await _indexPack({
      fs: new FileSystem(fs),
      cache,
      onProgress,
      dir,
      gitdir,
      filepath,
    })
  } catch (err) {
    err.caller = 'git.indexPack'
    throw err
  }
}
Create the .idx file for a given .pack file

@param {object} args
@param {FsClient} args.fs - a file system client
@param {ProgressCallback} [args.onProgress] - optional progress event callback
@param {string} args.dir - The [working tree](dir-vs-gitdir.md) directory path
@param {string} [args.gitdir=join(dir,'.git')] - [required] The [git directory](dir-vs-gitdir.md) path
@param {string} args.filepath - The path to the .pack file to index
@param {object} [args.cache] - a [cache](cache.md) object

@returns {Promise<{oids: string[]}>} Resolves with a list of the SHA-1 object ids contained in the packfile

@example
let packfiles = await fs.promises.readdir('/tutorial/.git/objects/pack')
packfiles = packfiles.filter(name => name.endsWith('.pack'))
console.log('packfiles', packfiles)

const { oids } = await git.indexPack({
  fs,
  dir: '/tutorial',
  filepath: `.git/objects/pack/${packfiles[0]}`,
  async onProgress (evt) {
    console.log(`${evt.phase}: ${evt.loaded} / ${evt.total}`)
  }
})
console.log(oids)