-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fae119
commit ba8238a
Showing
1 changed file
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,9 @@ The reason can be seen here: | |
#### definition | ||
```ts | ||
import { tar } from "https://deno.land/x/[email protected].7/mod.ts"; | ||
import { tar } from "https://deno.land/x/[email protected].8/mod.ts"; | ||
// or only import tar | ||
// import { tar } from "https://deno.land/x/[email protected].7/tar/mod.ts"; | ||
// import { tar } from "https://deno.land/x/[email protected].8/tar/mod.ts"; | ||
export interface compressInterface { | ||
excludeSrc?: boolean; // exclude src directory, default: include src directory | ||
} | ||
|
@@ -30,7 +30,7 @@ tar.uncompress(src, dest): Promise<void>; | |
|
||
#### example | ||
```ts | ||
import { tar } from "https://deno.land/x/[email protected].7/mod.ts"; | ||
import { tar } from "https://deno.land/x/[email protected].8/mod.ts"; | ||
// compress folder | ||
await tar.compress("./test","./test.tar"); | ||
// compress folder, exclude src directory | ||
|
@@ -50,9 +50,9 @@ import { | |
/** Compress data using deflate, and do not append a zlib header. */ | ||
deflateRaw, | ||
inflateRaw | ||
} from "https://deno.land/x/[email protected].7/mod.ts"; | ||
} from "https://deno.land/x/[email protected].8/mod.ts"; | ||
// or only import deflate, inflate, deflateRaw, inflateRaw | ||
// import { deflate, inflate, deflateRaw, inflateRaw } from "https://deno.land/x/[email protected].7/zlib/mod.ts"; | ||
// import { deflate, inflate, deflateRaw, inflateRaw } from "https://deno.land/x/[email protected].8/zlib/mod.ts"; | ||
const str = "hello world!"; | ||
const bytes = new TextEncoder().encode(str); | ||
// with zlib header | ||
|
@@ -89,9 +89,9 @@ compress and uncompress file, only supports compressing and decompressing a sing | |
__stream mode__ | ||
used to read and write large files | ||
```ts | ||
import { GzipStream } from "https://deno.land/x/[email protected].7/mod.ts"; | ||
import { GzipStream } from "https://deno.land/x/[email protected].8/mod.ts"; | ||
// or only import GzipStream | ||
// import { GzipStream } from "https://deno.land/x/[email protected].7/gzip/mod.ts"; | ||
// import { GzipStream } from "https://deno.land/x/[email protected].8/gzip/mod.ts"; | ||
const gzip = new GzipStream(); | ||
gzip.on("progress", (progress: string) => { | ||
console.log(progress); // 0.00% => 100.00% | ||
|
@@ -103,19 +103,19 @@ await gzip.uncompress("./big.mkv.gz", "./big.mkv"); | |
__no stream mode__ | ||
loading all data into memory, so can't get `progress` event | ||
```ts | ||
import { gzipFile, gunzipFile } from "https://deno.land/x/[email protected].7/mod.ts"; | ||
import { gzipFile, gunzipFile } from "https://deno.land/x/[email protected].8/mod.ts"; | ||
// or only import gzipFile, gunzipFile | ||
// import { gzipFile, gunzipFile } from "https://deno.land/x/[email protected].7/gzip/mod.ts"; | ||
// import { gzipFile, gunzipFile } from "https://deno.land/x/[email protected].8/gzip/mod.ts"; | ||
await gzipFile("./deno.txt", "./deno.txt.gz"); | ||
await gunzipFile("./deno.txt.gz", "./deno.txt"); | ||
``` | ||
|
||
**gzip/gunzip string or bytes** | ||
> This is a pure TypeScript implementation. Almost as fast as Rust implementation. | ||
```ts | ||
import { gzip, gunzip } from "https://deno.land/x/[email protected].7/mod.ts"; | ||
import { gzip, gunzip } from "https://deno.land/x/[email protected].8/mod.ts"; | ||
// or only import gzip, gunzip | ||
// import { gzip, gunzip } from "https://deno.land/x/[email protected].7/zlib/mod.ts"; | ||
// import { gzip, gunzip } from "https://deno.land/x/[email protected].8/zlib/mod.ts"; | ||
// gzip | ||
const bytes = new TextEncoder().encode("hello"); | ||
const compressed = gzip(bytes); | ||
|
@@ -127,9 +127,9 @@ const decompressed = gunzip(compressed); | |
|
||
#### definition | ||
```ts | ||
import { tgz } from "https://deno.land/x/[email protected].7/mod.ts"; | ||
import { tgz } from "https://deno.land/x/[email protected].8/mod.ts"; | ||
// or only import tgz | ||
// import { tgz } from "https://deno.land/x/[email protected].7/tgz/mod.ts"; | ||
// import { tgz } from "https://deno.land/x/[email protected].8/tgz/mod.ts"; | ||
interface compressInterface { | ||
excludeSrc?: boolean; // exclude src directory, default: include src directory | ||
} | ||
|
@@ -139,7 +139,7 @@ tgz.uncompress(src, dest): Promise<void>; | |
|
||
#### example | ||
```ts | ||
import { tgz } from "https://deno.land/x/[email protected].7/mod.ts"; | ||
import { tgz } from "https://deno.land/x/[email protected].8/mod.ts"; | ||
// compress folder | ||
await tgz.compress("./test","./test.tar.gz"); | ||
// compress folder, exclude src directory | ||
|
@@ -155,7 +155,7 @@ Not implemented | |
|
||
#### definition | ||
```ts | ||
import { zip } from "https://deno.land/x/[email protected].7/mod.ts"; | ||
import { zip } from "https://deno.land/x/[email protected].8/mod.ts"; | ||
interface compressInterface { | ||
excludeSrc?: boolean; // exclude src directory, default: include src directory | ||
} | ||
|