new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Bun · Runtime · all subjects

bun apis/compression

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Compression APIs: gzip, deflate, zstd

Bun provides compression utilities: Bun.gzipSync() and Bun.gunzipSync() for gzip compression, Bun.deflateSync() and Bun.inflateSync() for deflate compression, and Bun.zstdCompressSync(), Bun.zstdDecompressSync(), Bun.zstdCompress(), and Bun.zstdDecompress() for Zstandard compression.

Bun.inflateSync() decompresses DEFLATE

Bun.inflateSync(buffer: Uint8Array): Uint8Array decompresses a Uint8Array using zlib's INFLATE algorithm.

Bun.gzipSync() compresses with GZIP

Bun.gzipSync(buffer: Uint8Array, options?: ZlibCompressionOptions): Uint8Array compresses a Uint8Array using zlib's GZIP algorithm. Optionally pass a parameters object with level, memLevel, windowBits, and strategy properties.

Bun.gunzipSync() decompresses GZIP

Bun.gunzipSync(buffer: Uint8Array): Uint8Array decompresses a Uint8Array using zlib's GUNZIP algorithm.

Bun.deflateSync() compresses with DEFLATE

Bun.deflateSync(buffer: Uint8Array, options?: ZlibCompressionOptions): Uint8Array compresses a Uint8Array using zlib's DEFLATE algorithm. The second argument supports the same configuration options as Bun.gzipSync.

ZlibCompressionOptions for Bun compression APIs

ZlibCompressionOptions object with properties: level (number -1 to 9, default 6), memLevel (1-9, default 8), windowBits (signed: -9 to -15 for raw deflate, unsigned 9-15 for deflate with header, 25-31 for gzip), strategy (number for compression strategy: Z_DEFAULT_STRATEGY, Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED).

Bun.zstdCompressSync() / Bun.zstdCompress() compress with Zstandard

Bun.zstdCompressSync(buffer: Uint8Array, options?: {level?: 1-22}): Uint8Array and Bun.zstdCompress(buffer: Uint8Array, options?: {level?: 1-22}): Promise<Uint8Array> compress using the Zstandard algorithm. Compression level defaults to 3 and ranges from 1-22.

Bun.zstdDecompressSync() / Bun.zstdDecompress() decompress Zstandard

Bun.zstdDecompressSync(buffer: Uint8Array): Uint8Array and Bun.zstdDecompress(buffer: Uint8Array): Promise<Uint8Array> decompress data using the Zstandard algorithm.

Give your agent this brain