{"id":13451943,"url":"https://github.com/pieroxy/lz-string","last_synced_at":"2025-05-07T11:52:20.349Z","repository":{"id":37451335,"uuid":"9938102","full_name":"pieroxy/lz-string","owner":"pieroxy","description":"LZ-based compression algorithm for JavaScript","archived":false,"fork":false,"pushed_at":"2024-08-06T12:06:16.000Z","size":1811,"stargazers_count":4244,"open_issues_count":55,"forks_count":572,"subscribers_count":89,"default_branch":"master","last_synced_at":"2025-05-01T05:09:12.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pieroxy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-08T14:26:27.000Z","updated_at":"2025-04-28T22:27:03.000Z","dependencies_parsed_at":"2022-07-09T09:30:22.540Z","dependency_job_id":"3cbc0ccf-b406-48d7-b10d-27aef0bc5d5e","html_url":"https://github.com/pieroxy/lz-string","commit_stats":{"total_commits":220,"total_committers":32,"mean_commits":6.875,"dds":0.5818181818181818,"last_synced_commit":"7d6da156b51486d400bd895f30ee14d1378079a3"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pieroxy%2Flz-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pieroxy%2Flz-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pieroxy%2Flz-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pieroxy%2Flz-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pieroxy","download_url":"https://codeload.github.com/pieroxy/lz-string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252126768,"owners_count":21698964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:01:07.686Z","updated_at":"2025-05-07T11:52:20.310Z","avatar_url":"https://github.com/pieroxy.png","language":"TypeScript","readme":"# lz-string\n\n[![Node.js CI](https://github.com/pieroxy/lz-string/actions/workflows/ci.yml/badge.svg)](https://github.com/pieroxy/lz-string/actions/workflows/ci.yml) ![Version](https://img.shields.io/github/package-json/v/pieroxy/lz-string/master.svg?logo=github) [![npm package](https://img.shields.io/npm/v/lz-string.svg?logo=npm)](https://www.npmjs.com/package/lz-string?logo=npm) ![Downloads](https://img.shields.io/npm/dw/lz-string.svg?logo=npm) [![Documentation](https://img.shields.io/badge/Documentation-blue?logo=readthedocs\u0026logoColor=midnightblue)](http://pieroxy.net/blog/pages/lz-string/index.html)\n\nLZ-based compression algorithm for JavaScript\n\n\u003e [!IMPORTANT]\n\u003e The file layout has changed in version 2, this is now a joint `commonjs` / `esmodule` project so modern build tools should be happy with it, but if importing a file directly (such as in a direct javascript project) it is important to use the correct one.\n\n\u003e [!TIP]\n\u003e The \"old style\" minified AMD file is available as `dist/index.umd.js` via various CDNs or package managers.\n\n## Install via [npm](https://www.npmjs.com/package/lz-string)\n\n```shell\n$ npm install -g lz-string\n$ lz-string input.txt \u003e output.txt\n```\n\n## Home page\n\nHome page for this program with examples, documentation and a live demo: http://pieroxy.net/blog/pages/lz-string/index.html\n\n## Command line\n\nIf installed globally there is a command line tool available, and a test suite that can use it to show things are working properly. If other langauges build a command line tool that supports the same arguments then the test suite can be run against them too.\n\n```console\n$ lz-string -h\nUsage: cli [options] [input-file]\n\nUse lz-string to compress or decompress a file\n\nArguments:\n  input-file                  file to process, if no file then read from stdin\n\nOptions:\n  -V, --version               output the version number\n  -d, --decompress            if unset then this will compress\n  -e, --encoder \u003ctype\u003e        character encoding to use (choices: \"base64\", \"encodeduri\", \"raw\", \"uint8array\", \"utf16\", default: \"raw\")\n  -v, --verify                verify before returning (default: true)\n  -b, --binary \u003cfile\u003e         lz-string binary to use (default: \"../dist/index.js\")\n  -l, --legacy                use legacy mode where uint8array decompression must be an even length\n  -o, --output \u003coutput-file\u003e  output file, otherwise write to stdout\n  -q, --quiet                 don't print any error messages\n  -h, --help                  display help for command\n```\n\n## Other languages\n\nThis lib has numerous ports to other languages, for server side processing, mostly. Here they are:\n\n\u003e [!CAUTION]\n\u003e These are all developed separately, so if you are using two versions to transfer data (such as a client and server version) it is important to check that they are compatible and have identical behaviours on the data!\n\n\u003e [!NOTE]\n\u003e Version 1.3.8 of this package had a slight change in the encoding which might impact compatibility.\n\n- **Java:** [by Diogo Duailibe](https://github.com/diogoduailibe/lzstring4j)\n- **Java:** [by rufushuang, with base64 support and better performances](https://github.com/rufushuang/lz-string4java)\n- **C#:** [by Jawa-the-Hutt](https://github.com/jawa-the-hutt/lz-string-csharp)\n- **C#:** [by kreudom, another implementation in C#, more up to date](https://github.com/kreudom/lz-string-csharp)\n- **PHP:** [by nullpunkt](https://github.com/nullpunkt/lz-string-php)\n- **Python3:** [by eduardtomasek](https://github.com/eduardtomasek/lz-string-python)\n- **Another Python:** [by marcel-dancak](https://github.com/marcel-dancak/lz-string-python)\n- **Ruby** [by Altivi](https://github.com/Altivi/lz_string)\n- **Go** [I helped a friend to write a Go implementation of the decompression algorithm](https://github.com/pieroxy/lz-string-go)\n- **Go** [Austin wrote the decompression part as well](https://github.com/Lazarus/lz-string-go)\n- **Go** [by daku10, another implementation supports multiple encoding formats and can be used as a CLI tool](https://github.com/daku10/go-lz-string)\n- **Elixir** [by Michael Shapiro](https://github.com/koudelka/elixir-lz-string)\n- **C++/QT** [by AmiArt](https://github.com/AmiArt/qt-lzstring)\n- **C++** [by Andrey Krasnov, another implementation in C++11](https://github.com/andykras/lz-string-cpp)\n- **VB.NET** [by gsemac](https://github.com/gsemac/lz-string-vb)\n- **Salesforce Apex** (Java like language): [bilal did the port](https://github.com/bilalfastian/LZ4String)\n- **Kotlin:** [from Zen Liu](https://github.com/ZenLiuCN/lz-string4k)\n- **Dart:** [from skipness](https://github.com/skipness/lzstring-dart)\n- **Haxe:** [from markknol](https://github.com/markknol/hx-lzstring)\n- **Rust:** [from adumbidiot](https://github.com/adumbidiot/lz-str-rs)\n","funding_links":[],"categories":["JavaScript","TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpieroxy%2Flz-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpieroxy%2Flz-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpieroxy%2Flz-string/lists"}