Skip to content

Commit

Permalink
v0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangfuxing committed Mar 14, 2022
1 parent c43a03c commit 9bb7cf1
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ For tar (un)compression, Deno v1.2.2+ is required. The reason can be seen here:
### Definition

```ts
import { tar } from "https://deno.land/x/[email protected].1/mod.ts";
import { tar } from "https://deno.land/x/[email protected].2/mod.ts";
// or only import tar
// import { tar } from "https://deno.land/x/[email protected].1/tar/mod.ts";
// import { tar } from "https://deno.land/x/[email protected].2/tar/mod.ts";
export interface compressInterface {
excludeSrc?: boolean; // exclude src directory, default: include src directory
}
Expand All @@ -36,7 +36,7 @@ tar.uncompress(src, dest): Promise<void>;
### Example

```ts
import { tar } from "https://deno.land/x/[email protected].1/mod.ts";
import { tar } from "https://deno.land/x/[email protected].2/mod.ts";
// compress folder
await tar.compress("./test", "./test.tar");
// compress folder, exclude src directory
Expand All @@ -60,9 +60,9 @@ import {
deflateRaw,
inflate,
inflateRaw,
} from "https://deno.land/x/[email protected].1/mod.ts";
} from "https://deno.land/x/[email protected].2/mod.ts";
// or only import deflate, inflate, deflateRaw, inflateRaw
// import { deflate, inflate, deflateRaw, inflateRaw } from "https://deno.land/x/[email protected].1/zlib/mod.ts";
// import { deflate, inflate, deflateRaw, inflateRaw } from "https://deno.land/x/[email protected].2/zlib/mod.ts";
const str = "hello world!";
const bytes = new TextEncoder().encode(str);
// with zlib header
Expand Down Expand Up @@ -103,9 +103,9 @@ and decompressing a single file.)
Useful for reading and writing large files.

```ts
import { GzipStream } from "https://deno.land/x/[email protected].1/mod.ts";
import { GzipStream } from "https://deno.land/x/[email protected].2/mod.ts";
// or only import GzipStream
// import { GzipStream } from "https://deno.land/x/[email protected].1/gzip/mod.ts";
// import { GzipStream } from "https://deno.land/x/[email protected].2/gzip/mod.ts";
const gzip = new GzipStream();
gzip.on("progress", (progress: string) => {
console.log(progress); // 0.00% => 100.00%
Expand All @@ -121,9 +121,9 @@ await gzip.uncompress("./big.mkv.gz", "./big.mkv");
import {
gunzipFile,
gzipFile,
} from "https://deno.land/x/[email protected].1/mod.ts";
} from "https://deno.land/x/[email protected].2/mod.ts";
// or only import gzipFile, gunzipFile
// import { gzipFile, gunzipFile } from "https://deno.land/x/[email protected].1/gzip/mod.ts";
// import { gzipFile, gunzipFile } from "https://deno.land/x/[email protected].2/gzip/mod.ts";
await gzipFile("./deno.txt", "./deno.txt.gz");
await gunzipFile("./deno.txt.gz", "./deno.txt");
```
Expand All @@ -134,9 +134,9 @@ await gunzipFile("./deno.txt.gz", "./deno.txt");
> implementation.
```ts
import { gunzip, gzip } from "https://deno.land/x/[email protected].1/mod.ts";
import { gunzip, gzip } from "https://deno.land/x/[email protected].2/mod.ts";
// or only import gzip, gunzip
// import { gzip, gunzip } from "https://deno.land/x/[email protected].1/zlib/mod.ts";
// import { gzip, gunzip } from "https://deno.land/x/[email protected].2/zlib/mod.ts";
// gzip
const bytes = new TextEncoder().encode("hello");
const compressed = gzip(bytes);
Expand All @@ -149,9 +149,9 @@ const decompressed = gunzip(compressed);
### Definition

```ts
import { tgz } from "https://deno.land/x/[email protected].1/mod.ts";
import { tgz } from "https://deno.land/x/[email protected].2/mod.ts";
// or only import tgz
// import { tgz } from "https://deno.land/x/[email protected].1/tgz/mod.ts";
// import { tgz } from "https://deno.land/x/[email protected].2/tgz/mod.ts";
interface compressInterface {
excludeSrc?: boolean; // exclude src directory, default: include src directory
}
Expand All @@ -162,7 +162,7 @@ tgz.uncompress(src, dest): Promise<void>;
### Example

```ts
import { tgz } from "https://deno.land/x/[email protected].1/mod.ts";
import { tgz } from "https://deno.land/x/[email protected].2/mod.ts";
// compress folder
await tgz.compress("./test", "./test.tar.gz");
// compress folder, exclude src directory
Expand All @@ -180,7 +180,7 @@ await tgz.uncompress("./test.tar.gz", "./dest");
### Definition

```ts
import { zip } from "https://deno.land/x/[email protected].1/mod.ts";
import { zip } from "https://deno.land/x/[email protected].2/mod.ts";
interface compressInterface {
excludeSrc?: boolean; // exclude src directory, default: include src directory
}
Expand Down

0 comments on commit 9bb7cf1

Please sign in to comment.