Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ const decompressed = zstdDecompressWithDict(compressed, dict);
| Function | Description |
| --- | --- |
| `gzipCompress(data, level?)` | Compress with gzip. Level: 0-9 (default: 6) |
| `gzipCompressWithHeader(data, header, level?)` | Compress with custom gzip header (filename, mtime) |
| `gzipReadHeader(data)` | Read gzip header metadata without decompressing |
| `gzipDecompress(data)` | Decompress gzip data |
| `gzipDecompressWithCapacity(data, capacity)` | Decompress with explicit output size limit |
| `deflateCompress(data, level?)` | Compress with raw deflate. Level: 0-9 (default: 6) |
Expand Down Expand Up @@ -179,6 +181,13 @@ const decompressed = zstdDecompressWithDict(compressed, dict);
| `decompress(data)` | Auto-detect format and decompress (zstd, gzip, brotli, lz4) |
| `detectFormat(data)` | Detect compression format. Returns `'zstd'`, `'gzip'`, `'brotli'`, `'lz4'`, or `'unknown'` |

#### Utilities

| Function | Description |
| --- | --- |
| `crc32(data, initialValue?)` | Compute CRC32 checksum (supports incremental computation) |
| `version()` | Returns the library version |

#### zstd Dictionary

| Function | Description |
Expand Down Expand Up @@ -220,6 +229,7 @@ All one-shot functions have async variants that run on the libuv thread pool, ke
| `createLz4DecompressStream()` | Create an LZ4 decompression `TransformStream` |
| `createZstdCompressDictStream(dict, level?)` | Streaming zstd compression with dictionary |
| `createZstdDecompressDictStream(dict)` | Streaming zstd decompression with dictionary |
| `createDecompressStream()` | Auto-detect format and create a decompression `TransformStream` |

### Node.js Transform Streams

Expand Down Expand Up @@ -251,6 +261,7 @@ await pipeline(
| `createLz4DecompressTransform()` | Node.js Transform for LZ4 decompression |
| `createZstdCompressDictTransform(dict, level?)` | Node.js Transform for zstd dict compression |
| `createZstdDecompressDictTransform(dict)` | Node.js Transform for zstd dict decompression |
| `createDecompressTransform()` | Auto-detect format and create a decompression Transform |

## Supported Algorithms

Expand Down
2 changes: 2 additions & 0 deletions browser-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export {
gzipCompressAsync,
gzipDecompress,
gzipDecompressAsync,
gzipCompressWithHeader,
gzipReadHeader,
gzipDecompressWithCapacity,
gzipDecompressWithCapacityAsync,
lz4Compress,
Expand Down
10 changes: 10 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ export const {
GzipDecompressContext,
DeflateCompressContext,
DeflateDecompressContext,
lz4Compress,
lz4Decompress,
lz4DecompressWithCapacity,
lz4CompressAsync,
lz4DecompressAsync,
lz4DecompressWithCapacityAsync,
Lz4CompressContext,
Lz4DecompressContext,
} = binding;

export const {
Expand All @@ -66,5 +74,7 @@ export const {
createGzipDecompressStream,
createDeflateCompressStream,
createDeflateDecompressStream,
createLz4CompressStream,
createLz4DecompressStream,
createDecompressStream,
} = streams;
Loading