lzma1
v0.0.3
Published
A JavaScript implementation of the Lempel-Ziv-Markov (LZMA) chain compression algorithm
Downloads
1,315
Maintainers
Readme
lzma1
This is a simplified fork of Nathan Rugg's package.
The goal of this fork is to simplify and extract the minimal implementation for my second project, I'm also trying to add as many typings as possible.
Install
npm registry
npm install lzma1
GitHub
# same as latest released npm registry version
npm install xseman/lzma1#master
# latest unreleased changes
npm install xseman/lzma1#develop
# specific tag version
npm install xseman/lzma1#0.0.1
API
compress(data: string | Uint8Array, mode?: Mode): Int8Array
decompress(bytearray: Uint8Array): Int8Array
Usage
Compress and decompress a string with compression level 1.
import { compress, decompress } from "lzma1"
const data = "Hello World!"
const compressed = compress(data, 1)
const decompressed = decompress(result)
// data === decompressed