xz-decoder-js
v1.0.2
Published
Pure JavaScript XZ decompression library with no external dependencies.
Downloads
14
Maintainers
Readme
xz-decoder-js
Pure JavaScript XZ decoder with no external dependencies.
xz-decoder-js is a lightweight JavaScript module that can decode .xz compressed data directly, without requiring any native bindings or external libraries.
This package is particularly useful in environments like Node.js where minimal dependencies and full portability are desired.
Features
- No dependencies
- Works in Node.js
- No need of WebAssembly
- Decodes
.xzformat (LZMA2 compression) - Pure JavaScript implementation
- Based on a Dart port
Installation
npm install xz-decoder-jsUsage Example
import { XZDecoder } from 'xz-decoder-js';
import fs from 'fs';
const data = fs.readFileSync('file.xz');
const decoder = new XZDecoder();
const decoded = decoder.decodeBytes(data);
fs.writeFileSync('output.bin', decoded);Credits
This project is based on the Dart archive package by Brendan Duncan, from which the core XZ decoding logic was adapted and ported to JavaScript.
License
This project is licensed under the MIT License.
