TypeScript 100.0%
4 1 0

Clone this repository

https://tangled.org/mary.my.id/pkg-maybe-decompression-stream
git@tangled.org:mary.my.id/pkg-maybe-decompression-stream

For self-hosted knots, clone URLs may differ based on your setup.

README.md

maybe-decompression-stream#

JSR | source code

decompresses a stream of data if it is compressed with gzip, otherwise it passes the data through.

const response = await fetch('resource.tgz');

const stream = response.body.pipeThrough(new MaybeDecompressionStream());

for await (const chunk of stream) {
	// ...
}