lz-ts
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

lz-ts

LZ-based compression algorithm for TypeScript projects (Browser, Node.js). This project is a TypeScript port of the original package lz-string using modern tooling.

Setup

yarn add lz-ts
npm i lz-ts

Usage

UTF16 encoded string compression

import { compress, decompress } from 'lz-ts'

const compressed = compress('input')
const decompressed = decompress(compressed)

URI encoded string compression

import { compressToURI, decompressFromURI } from 'lz-ts'

const compressedURI = compressToURI('input')
const decompressedURI = decompressFromURI(compressed)

Limitations

This project intentionally doesn't implement the base64 encoding.

Test

yarn test

Package Sidebar

Install

npm i lz-ts

Weekly Downloads

952

Version

1.1.2

License

MIT

Unpacked Size

7.04 kB

Total Files

6

Last publish

Collaborators

  • kyr0