Module for compressing strings using the browsers built in gzip zipping functionality. Hence this module is made for browsers and have not been tested on server-side environments.
npm install gzip-string
import { compress, decompress } from 'gzip-string'
const compressedData = await compress([YOUR STRING])
const yourString = await decompress(compressedData)
- compress
- decompress
- compressToURI
- decompressFromURI
Compresses the string using the browsers internal compression method.
Decompresses the provided using the browsers internal decompression method.
Compresses the string using the browsers internal compression method and makes sure it is safe to put in the URI.
Decompresses URI encoded strings using the browsers internal compression.