One-shot inflate decompress. Autodetects gzip/zlib format via the wrapper header — so ungzip is just a convenience alias of this function. See InflateOptions for zlib options. Set toText: true to decode the result as UTF-8 text.
gzip
zlib
toText: true
import { deflate, inflate } from 'pako'const input = deflate(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]))let outputtry { output = inflate(input)} catch (err) { console.log(err)} Copy
import { deflate, inflate } from 'pako'const input = deflate(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]))let outputtry { output = inflate(input)} catch (err) { console.log(err)}
One-shot inflate decompress. Autodetects
gzip/zlibformat via the wrapper header — so ungzip is just a convenience alias of this function. See InflateOptions for zlib options. SettoText: trueto decode the result as UTF-8 text.