# pieroxy/lz-string

LZ-based compression algorithm for JavaScript

Repository: https://github.com/pieroxy/lz-string
Canonical: https://ross.abutalabs.com/products/lz-string
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2025-08-11T20:23:21+00:00

## Health v2 (maintenance only)
Score: 39/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 36, release rhythm 8, longevity 100
- inputs: {"age_days": 4865, "days_push": 387, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4429, forks 568 (observed 2026-08-28T04:08:49.140255+00:00)

## What it is
A JavaScript/TypeScript library implementing an LZ-based compression algorithm optimized for strings, with multiple output encodings (UTF16, base64, URI-safe, Uint8Array). It also ships a CLI for compressing and decompressing files and has ports to many other languages.

## Use cases
- compress large strings before storing them in localStorage
- shrink JSON payloads sent from client to server
- compress data into URL-safe strings
- compress files from the command line
- decompress data produced by lz-string ports in other languages

## When to choose
- you need fast, dependency-free string compression in JavaScript or the browser
- you want to compress data for localStorage, URLs, or small payloads
- you need a simple CLI for lz-string compression

## When to avoid
- you need maximum compression ratios on large binary files (use gzip, zstd, or brotli)
- you need cross-language compatibility without verifying port behavior
- you are compressing data where a standard format is required

## Facets
- artifact type: library
- maturity: stable
- function: compression, serialization, cli
- domain: developer-tools, files, web-development
- platform: browser, cli, cross-platform
- tags: lz-compression, string-compression, javascript, typescript, nodejs

## Member repositories
- pieroxy/lz-string (main) score 39

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:49.140255+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:20:55.065564+00:00, confidence not recorded.
  - readme: https://github.com/pieroxy/lz-string (fetched 2026-08-28T04:08:49.140255+00:00, sha a0ea7879faea)
  - registry_npm: https://registry.npmjs.org/lz-string (fetched 2026-08-29T09:08:35.143736+00:00, sha dcd311bd5b39)
- Data as of 2026-08-30T08:39:29.467469+00:00.
