@napi-rs/lzma
lzma-rs binding to Node.js via napi-rs.
🚀 Help me to become a full-time open-source developer by sponsoring me on Github
Install
yarn add @napi-rs/lzma
Support matrix
| node12 | node14 | node16 | node17 |
---|
Windows x64 | ✓ | ✓ | ✓ | ✓ |
Windows x32 | ✓ | ✓ | ✓ | ✓ |
Windows arm64 | ✓ | ✓ | ✓ | ✓ |
macOS x64 | ✓ | ✓ | ✓ | ✓ |
macOS arm64 (m chips) | ✓ | ✓ | ✓ | ✓ |
Linux x64 gnu | ✓ | ✓ | ✓ | ✓ |
Linux x64 musl | ✓ | ✓ | ✓ | ✓ |
Linux arm gnu | ✓ | ✓ | ✓ | ✓ |
Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ |
Linux arm64 musl | ✓ | ✓ | ✓ | ✓ |
Android arm64 | ✓ | ✓ | ✓ | ✓ |
Android armv7 | ✓ | ✓ | ✓ | ✓ |
FreeBSD x64 | ✓ | ✓ | ✓ | ✓ |
API
xz
import { compress, decompress } from '@napi-rs/lzma/xz'
const compressed = await compress('Hello napi-rs 🚀')
const decompressed = await decompress(compressed)
console.log(decompressed.toString('utf8'))
lzma
import { compress, decompress } from '@napi-rs/lzma/lzma'
const compressed = await compress('Hello napi-rs 🚀')
const decompressed = await decompress(compressed)
console.log(decompressed.toString('utf8'))
lzma2
import { compress, decompress } from '@napi-rs/lzma/lzma2'
const compressed = await compress('Hello napi-rs 🚀')
const decompressed = await decompress(compressed)
console.log(decompressed.toString('utf8'))