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

x/ayonli_jsext/archive/tar.ts>default

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

Archives the specified directory and puts it to the specified tarball file.

NOTE: This function puts the directory itself into the archive, similar to tar -cf archive.tar <directory> in Unix-like systems.

Examples

Example 1

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

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

Parameters

src: string | FileSystemDirectoryHandle
dest: string | FileSystemFileHandle
optional
options: TarOptions

Returns

Promise<void>

Creates a Tarball instance and puts the the specified directory into the archive.

NOTE: This function puts the directory itself into the archive, similar to tar -cf archive.tar <directory> in Unix-like systems.

Examples

Example 1

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

const tarball = await tar("/path/to/directory");

Parameters

src: string | FileSystemDirectoryHandle
optional
options: FileSystemOptions