gzipBytesfunction
Gzip bytes, with the web's own CompressionStream: the form a site hosts a packed file in.
Import it
import { gzipBytes } from "@johnmorrisdotca/chikyu-earth/catalogue";
Definition
function gzipBytes(bytes: Uint8Array): Promise<Uint8Array>
Parameters
| Name | Type | Description |
|---|---|---|
bytes | Uint8Array<ArrayBufferLike> | What |
Returns
Promise<Uint8Array<ArrayBufferLike>>
The gzipped bytes.
Examples
import { gzipBytes } from "@johnmorrisdotca/chikyu-earth/catalogue";
const small = await gzipBytes(new Uint8Array(10_000));
console.log(small.length < 100, small[0], small[1]);true 31 139What it prints (run when this page was built)