JSPM

gzip-string

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 219
  • Score
    100M100P100Q78452F
  • License MIT

Module for compressing strings using the browsers built in gzip zipping functionality.

Package Exports

  • gzip-string
  • gzip-string/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gzip-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gzip-string

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.

Install

npm install gzip-string

Example

import { compress, decompress } from 'gzip-string'

const compressedData = await compress([YOUR STRING])

const yourString = await decompress(compressedData)

Functions:

  • compress
  • decompress
  • compressToURI
  • decompressFromURI
compress(string, (encoding = 'gzip'))

Compresses the string using the browsers internal compression method.

decompress(string, (encoding = 'gzip'))

Decompresses the provided using the browsers internal decompression method.

compressToURI(string, (encoding = 'gzip'))

Compresses the string using the browsers internal compression method and makes sure it is safe to put in the URI.

decompressFromURI(string, (encoding = 'gzip'))

Decompresses URI encoded strings using the browsers internal compression.