---
title: TarParser
---

# TarParser

<a href="https://github.com/remix-run/remix/blob/remix@3.0.0-alpha.6/packages/tar-parser/src/lib/tar.ts#L273" target="_blank">View Source</a>

## Summary

A parser for tar archives.

## Signature

```ts
class TarParser {
  constructor(options: ParseTarHeaderOptions): TarParser;

  // Methods
  parse(archive: TarArchiveSource, handler: TarEntryHandler): Promise<void>;
}

```

## Constructor Params

### options

Options that control how the tar archive is parsed

## Methods

### parse(archive: TarArchiveSource, handler: TarEntryHandler): Promise<void>

Parse a stream/buffer tar archive and call the given handler for each entry it contains.
Resolves when the parse is finished and all handlers resolve.

#### archive

The tar archive source data

#### handler

A function to call for each entry in the archive