a simple ~1.4 kB minified and gzipped implementation of the lzo1x codec written in TypeScript
Install the package using your desired package manager.
lzo.ts is fully compatible with yarn, pnpm, deno and bun.
npm install lzo-ts
import { LZO } from 'lzo-ts';
const input = new TextEncoder().encode('Hello world!');
const compressed = LZO.compress(input);
const decompressed = LZO.decompress(compressed);
console.log(decompressed); // Returns "Hello world!"
If you are using the library in a web environment, you can include it directly from a CDN of your choice.
<script src="https://www.unpkg.com/lzo-ts"></script>
<script>
const { LZO } = lzoTs;
LZO.compress(/*...*/);
LZO.decompress(/*...*/);
</script>
Based on the efforts of
- abraidwood's JavaScript implementation and
- zzattack's C# implementation.
As well as the original work of Markus F.X.J. Oberhumer.
This project is licensed under the GPL-3.0 license, compatible with the original GPL-2.0 licensed code it utilizes.