@cornerstonejs/codec-openjph

中文文档
2.4.11发布于 2026/09/04MITCommonJS零依赖构建来源已验证近 30 天下载 43.2万

JS/WebAssembly build of OpenJPH

原始使用文档
文档目录3 节
  1. Try It Out!
  2. Building
  3. Testing

openjphjs - HTJ2K support

JavaScript/WebAssembly build of OpenJPH.

Try It Out!

Try it in your browser here (The @cornerstonejs version doesn't run this way any longer)

Building

This project uses Visual Studio Remote Containers to simplify setup and running (everything is contained in a docker image). Use the devconvtainer from the root codecs packages for the @cornerstonejs/codecs version.

This project uses git submodules to pull in OpenJPH. If developing, initialize the git submodules first (do this outside the container):

> $ git submodule update --init --recursive

To build WASM:

> ./build.sh

To build native C/C++ version:

> ./build-native.sh

To update to latest version of OpenJPH

> git submodule update --remote --merge

Testing

pnpm run build   # compile wasm into dist/
pnpm run test    # run vitest against dist/

Tests skip cleanly when dist/ is absent.

版本与发布记录

@cornerstonejs/codec-openjph 共发布 15 个版本,首次发布于 2022/10/24;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.4.11latest2026/09/042 个月前
2.4.102026/09/012 个月前
2.4.92026/08/142 个月前
2.4.82026/08/112 个月前
2.4.72024/12/111.9 年前
2.4.52023/11/093 年前

关于 @cornerstonejs/codec-openjph 的常见问题

@cornerstonejs/codec-openjph 是什么?

JS/WebAssembly build of OpenJPH

如何安装 @cornerstonejs/codec-openjph?

在项目目录运行 npm install @cornerstonejs/codec-openjph,或使用 pnpm add / yarn add / bun add。

@cornerstonejs/codec-openjph 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cornerstonejs__codec-openjph 是否存在。

@cornerstonejs/codec-openjph 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@cornerstonejs/codec-openjph 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=0.14。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@cornerstonejs/codec-openjph 可以商用吗?

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

@cornerstonejs/codec-openjph 的下载量有多少?

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

@cornerstonejs/codec-openjph 还在维护吗?

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