@paddor/burli
v0.1.2
Published
Memory-safe Brotli compression in Rust, with the API of the Brotli functions of node:zlib
Maintainers
Readme
burli
Brotli compression and decompression for Node.js, built on
burli, a Brotli codec in safe Rust. The
API matches the Brotli functions of node:zlib:
const burli = require("@paddor/burli");
const compressed = burli.brotliCompressSync(data);
burli.brotliDecompressSync(compressed).equals(data); // truebrotliCompress, brotliDecompress, createBrotliCompress,
createBrotliDecompress, and constants take the options of node:zlib and
fail with its error codes. Callback functions and streams run on the libuv
thread pool.
Differences from node:zlib:
- Qualities 6 to 11 run as 5, and the default quality is 5.
- Data after the end of the stream is an error. Malformed streams fail with
code
ERR_BURLI_DECOMPRESSION_FAILED; truncated ones fail withZ_BUF_ERROR, as innode:zlib. BROTLI_PARAM_SIZE_HINT,BROTLI_PARAM_LARGE_WINDOW,BROTLI_PARAM_NPOSTFIX,BROTLI_PARAM_NDIRECT, andBROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELINGhave no effect.- The
infooption is not supported.
Packages come prebuilt for Linux (glibc and musl), macOS, and Windows, on x64 and arm64. Node 22 or later.
