Skip to main content

compress-json-jz64

Documentation / datasets/compress-json-jz64

compressBase64ZipText()​

function compressBase64ZipText(dataOrZip: string, options?: object): Promise<string>;

Defined in: datasets/compress-json-jz64.js:14

Compress/decompress any data (such as JSON or text) with JSZip then convert zip binary to a Base64Zip text string which is easier to store in db or files.

Parameters​

ParameterTypeDescription

dataOrZip

string

data to compress, or Base64Zip to decompress

options?

{ compressionLevel: number; decompress: boolean; }

options.compressionLevel?

number

default=9 0-9, 9 has smallest size at ~40% but takes longer

options.decompress?

boolean

default=false false to compress, true to decompress

Returns​

Promise<string>

base64-encoded string of the zipped data