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
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>
optional
options: UntarOptionsLoads the specified tarball file to a Tarball instance.
Examples
Example 1
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