inflate(data[, options]) -> Uint8Array|String
Decompress data with inflate/ungzip and options. Autodetect
format via wrapper header by default. That's why we don't provide
separate ungzip method.
Supported options are:
http://zlib.net/manual.html#Advanced for more information.
Sugar (options):
raw (Boolean) - say that we work with raw stream, if you don't wish to specify
negative windowBits implicitly.to (String) - if equal to 'string', then result will be converted
from utf8 to utf16 (javascript) string. When string output requested,
chunk length can differ from chunkSize, depending on content.const pako = require('pako');
const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));
let output;
try {
output = pako.inflate(input);
} catch (err) {
console.log(err);
}
ungzip(data[, options]) -> Uint8Array|String
Just shortcut to [[inflate]], because it autodetects format by header.content. Done for convenience.