Skip to main content

Compress Strings with lz‑string

I wanted to compress some large strings in JavaScript, for an experiment with WebRTC, and found the excellent lz-string by pieroxy.

It’s fast, and it weighs just a little over 4KB if you run it through something like Terser. I’ve tweaked it ever so slightly for my needs, but it should still be 100% compatible with the original. You can play with it below.


Resources

See also