From f4d63e455ac794052d3ea1c1241e9d45b4ba7507 Mon Sep 17 00:00:00 2001 From: Ryc O'Chet Date: Sun, 14 Jan 2024 14:24:37 +0000 Subject: [PATCH] Update README.md --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 585d52b..9f5385d 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ 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) +[![Node.js CI](https://github.com/pieroxy/lz-string/actions/workflows/node.js.yml/badge.svg)](https://github.com/pieroxy/lz-string/actions/workflows/node.js.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&logoColor=midnightblue)](http://pieroxy.net/blog/pages/lz-string/index.html) -Sorry about the mess in other repos. This will not happen again. +LZ-based compression algorithm for JavaScript -## Note on server side +> [!IMPORTANT] +> 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. -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. +> [!TIP] +> The "old style" minified UMD file is available in `dist/index.umd.js` via various CDNs or package managers. -## Install via [npm](https://npmjs.org/) +## Install via [npm](https://www.npmjs.com/package/lz-string) ```shell $ npm install -g lz-string -$ lz-string input.js > output.txt +$ lz-string input.txt > output.txt ``` ## Home page @@ -24,6 +24,11 @@ Home page for this program with examples, documentation and a live demo: http:// ## Other languages This lib has numerous ports to other languages, for server side processing, mostly. Here they are: +> [!CAUTION] +> 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! + +> [!NOTE] +> Version 1.3.8 of this package had a slight change in the encoding which might impact compatibility. * **Java:** [by Diogo Duailibe](https://github.com/diogoduailibe/lzstring4j) * **Java:** [by rufushuang, with base64 support and better performances](https://github.com/rufushuang/lz-string4java)