lz-string

LZ-based compression algorithm for JavaScript

Warning (migrating from version 1.3.4 - nov 2014)

Files have changed locations and name since a recent release. The new release file is in libs/lz-string.min.js (or in libs/lz-string.js if you don't care for the minified version)

Sorry about the mess in other repos. This will not happen again.

Note on server side

If you are using one of the ports of lz-string to decode on the server what was encoded in the browser, you might want to use version 1.3.7 as the version 1.3.8 introduced a slight change in the encoding. While the JS versions are completely cross-compatible, the PHP, Go, ... versions might not be as forgiving.

Install via npm

$ npm install -g lz-string
$ lz-string input.js > output.txt

Home page

Home page for this program with examples, documentation and a live demo: http://pieroxy.net/blog/pages/lz-string/index.html

Other languages

This lib has numerous ports to other languages, for server side processing, mostly. Here they are:

lz-string - Installation

To install lz-string via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install lz-string --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install lz-string

Learn more about the config option.

PNPM

pnpm install lz-string --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install lz-string --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

lz-string - Download

Download Tarball (v1.5.0)

Integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==
SHASUM c1ab50f77887b712621201ba9fd4e3a6ed099941
Tarball https://js.registry.sudovanilla.org/lz-string/-/lz-string-1.5.0.tgz