Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/archive.ts>untar

A JavaScript extension package for building strong and modern applications.
Latest
function untar
Re-export
import { untar } from "https://deno.land/x/ayonli_jsext@v0.9.72/archive.ts";

Extracts files from a tarball file and writes them to the specified directory.

NOTE: If the destination directory does not exist, it will be created.

Examples

Example 1

import { untar } from "@ayonli/jsext/archive";

await untar("/path/to/archive.tar", "/path/to/directory");
// with gzip
await untar("/path/to/archive.tar.gz", "/path/to/directory", { gzip: true });

Parameters

src: string | FileSystemFileHandle | ReadableStream<Uint8Array>
dest: string | FileSystemDirectoryHandle
optional
options: UntarOptions

Returns

Promise<void>

Loads the specified tarball file to a Tarball instance.

Examples

Example 1

import { untar } from "@ayonli/jsext/archive";

const tarball = await untar("/path/to/archive.tar");
// with gzip
const tarball = await untar("/path/to/archive.tar.gz", { gzip: true });

Parameters

src: string | FileSystemFileHandle | ReadableStream<Uint8Array>
optional
options: TarOptions