parseTar

View Source

Summary

Parse a tar archive and call the given handler for each entry it contains.

import { parseTar } from 'remix/tar-parser';

await parseTar(archive, (entry) => {
 console.log(entry.name);
});

Signature

function parseTar(
  archive: TarArchiveSource,
  handler: TarEntryHandler,
): Promise<void>;

function parseTar(
  archive: TarArchiveSource,
  options: ParseTarHeaderOptions,
  handler: TarEntryHandler,
): Promise<void>;

Params

archive

The tar archive source data

options

handler

A function to call for each entry in the archive

Returns

A promise that resolves when the parse is finished