@blu3r4y/lzma

中文文档
2.3.3发布于 2022/03/05MITTypeScript零依赖近 30 天下载 6408

A JavaScript implementation of the Lempel-Ziv-Markov (LZMA) chain compression algorithm, ready to be used as an ES6 package

原始使用文档

LZMA-JS ES6 + Types

This is an E6 module with type definitions of the LZMA-JS package by Nathan Rugg, which was then extended by Kaito Udagawa.

LZMA-JS is a JavaScript implementation of the Lempel-Ziv-Markov (LZMA) chain compression algorithm. Please find full details in the original README: https://github.com/LZMA-JS/LZMA-JS

Installation

Install with NPM or Yarn.

npm install @blu3r4y/lzma
yarn add @blu3r4y/lzma

Usage

Compress and decompress a string with compression level 1.

import { compress, decompress } from "@blu3r4y/lzma";

const data = "Hello World!";
const compressed = compress(data, 1);
const decompressed = decompress(result);

// data === decompressed

You may also use the callback interface or supply byte arrays.
The interface is the same as in the original package.

function compress(data: string | Uint8Array, mode: Mode);
function compress(
    data: string | Uint8Array,
    mode: Mode,
    on_finish: (result: Uint8Array, error: any) => void,
    on_progress?: (percent: number) => void
);

function decompress(data: Uint8Array);
function decompress(
    data: Uint8Array,
    on_finish: (result: string | Uint8Array, error: any) => void,
    on_progress?: (percent: number) => void
);

版本与发布记录

@blu3r4y/lzma 共发布 3 个版本,首次发布于 2022/03/05;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.3.3latest2022/03/054 年前
2.3.2-es6-rc22022/03/054 年前
2.3.2-es6-rc12022/03/054 年前

关于 @blu3r4y/lzma 的常见问题

@blu3r4y/lzma 是什么?

A JavaScript implementation of the Lempel-Ziv-Markov (LZMA) chain compression algorithm, ready to be used as an ES6 package

如何安装 @blu3r4y/lzma?

在项目目录运行 npm install @blu3r4y/lzma,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 lzma.js,可以用 npx lzma.js 直接运行。

@blu3r4y/lzma 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@blu3r4y/lzma 可以商用吗?

@blu3r4y/lzma 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@blu3r4y/lzma 的下载量有多少?

根据 npm 官方下载统计,@blu3r4y/lzma 在 2026/10/09 – 2026/11/07 这 30 天内被下载 6,408 次,日均约 214 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@blu3r4y/lzma 还在维护吗?

最新版本 2.3.3 发布于 2022/03/05(4 年前);至今共发布 3 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/03/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。