node-heatshrink
v1.1.0
Published
[Heatshrink](https://github.com/atomicobject/heatshrink/tree/develop)'s [Rust implementation](https://crates.io/crates/heatshrink) binding library using `napi-rs`.
Downloads
6
Readme
Heatshrink compression for Node.js
Heatshrink's Rust implementation binding library using napi-rs
.
Usage
export function encodeSync(input: Buffer, windowSize: number, lookaheadSize: number): Buffer
export function decodeSync(input: Buffer, windowSize: number, lookaheadSize: number): Buffer
export function encode(input: Buffer, windowSize: number, lookaheadSize: number, signal?: AbortSignal | undefined | null): Promise<Buffer>
export function decode(input: Buffer, windowSize: number, lookaheadSize: number, signal?: AbortSignal | undefined | null): Promise<Buffer>
where:
encode()
andencodeSync()
are for compression;decode()
anddecodeSync()
are for decompression.windowSize
can be 8-11,lookaheadSize
is recommended to be the half of, or slightly less than half of thewindowSize
.
License
MIT