Project · 2025

xz-decoder-js

A pure JavaScript XZ decoder that can decode .xz compressed data without native bindings, WebAssembly or external dependencies.

JavaScriptXZLZMA2

Why it exists

xz-decoder-js exists for environments where portability and dependency minimization matter. It decodes .xz compressed data directly in JavaScript without native bindings or WebAssembly.

Architecture

  • The module exposes an XZDecoder class.
  • Compressed bytes are read and decoded directly in JavaScript.
  • The core logic was adapted from the Dart archive package by Brendan Duncan.
  • The package targets Node.js usage while keeping the dependency surface at zero.

Key features

  • Pure JavaScript implementation.
  • No external dependencies.
  • No WebAssembly requirement.
  • Node.js compatible.
  • Available on npm.
  • Supports XZ/LZMA2 decoding.

Design decisions

The project follows a portability-first approach. Instead of binding to native libraries or relying on WebAssembly, it keeps the decoder self-contained and easy to embed.

Links