diff --git a/tar/dev.sh b/tar/dev.sh old mode 100755 new mode 100644 diff --git a/tar/src/mod.ts b/tar/src/mod.ts index 7c288bf..bb37261 100644 --- a/tar/src/mod.ts +++ b/tar/src/mod.ts @@ -2,6 +2,12 @@ import { FS, Path } from "./deps.ts"; import { Tar, Untar } from "./tar.ts"; +/** + * Uncompresses a tar file to a certain location + * @param {string} src Tar file to be uncompressed + * @param {string} dest The location to uncompress to + * @returns A promise that is resolved once the tar file finished uncompressing + */ export async function uncompress(src: string, dest: string): Promise { const tarFile = await Deno.open(src, { read: true }); const untar = new Untar(tarFile); @@ -23,9 +29,19 @@ export async function uncompress(src: string, dest: string): Promise { } export interface ICompressOptions { + /** + * Controls wether all files inside the tar should be prefixed with the foldername or not + */ excludeSrc?: boolean; } +/** + * Compress file or folder into a .tar file + * @param {string} src File or folder to compress + * @param {string} dest Path of the resulting .tar file + * @param {ICompressOptions} options Options to controll behavious + * @returns A promise that is resolved once the tar file finished compressing + */ export async function compress( src: string, dest: string,