@byteink/mppjs

中文文档
0.1.8发布于 2026/09/18MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 4342

Convert Microsoft Project (.mpp) files to XML from Node, Bun, or Deno. Native binary, no JVM required.

原始使用文档
文档目录6 节
  1. Why
  2. Install
  3. API
  4. CLI
  5. Building from source
  6. License

@byteink/mppjs

Convert Microsoft Project (.mpp) files to MSPDI XML from Node, Bun, or Deno. Native binary, no JVM required at runtime.

npx @byteink/mppjs project.mpp                  # → project.xml
npx @byteink/mppjs project.mpp out/result.xml
import { convert } from "@byteink/mppjs";

const { outputPath } = await convert("project.mpp", "out.xml");

Why

The standard tool for parsing .mpp is MPXJ (Java). @byteink/mppjs ships MPXJ as a GraalVM-AOT-compiled native binary, so you get the parser without Docker, without a JVM, without jpype/IKVM, and without a multi-second cold start.

Install

npm install @byteink/mppjs   # or pnpm add / yarn add / bun add

The native binary for your platform is delivered via an optionalDependencies sidecar (@byteink/mppjs-<platform>-<arch>). Supported targets:

PlatformSidecar package
macOS arm64@byteink/mppjs-darwin-arm64
Linux x64@byteink/mppjs-linux-x64
Linux arm64@byteink/mppjs-linux-arm64
Windows x64@byteink/mppjs-win32-x64

If your platform isn't listed, open an issue.

API

import { convert, type ConvertOptions, type ConvertResult } from "@byteink/mppjs";

await convert(input: string, output?: string, options?: ConvertOptions): Promise<ConvertResult>
  • input — path to .mpp, .mpx, or any format MPXJ understands
  • output — path for the MSPDI XML; defaults to <input-without-ext>.xml
  • options.binaryPath — override the bundled binary path (also via MPPJS_BINARY env var)
  • options.timeoutMs — kill the spawned process after this many ms (default 60_000)

CLI

Usage: mppjs <input> [output.xml]

Exit codes: 0 ok, 1 conversion failure, 2 usage/IO error.

Building from source

Requires Liberica NIK 23.1.x (or any GraalVM JDK 21 distribution including native-image) and Maven 3.9+.

git clone https://github.com/byteink/mppjs
cd mppjs
npm install
npm run build              # jar → native binary → tsc
npm test                   # via bun, against MPXJ sample files

The native-image build takes 5–8 minutes on a modern laptop.

See CLAUDE.md for architecture details, including how the reflection metadata under .ni-config/ is regenerated when MPXJ is upgraded.

License

  • The TypeScript wrapper (this package) is MIT.
  • The platform-specific binaries shipped via @byteink/mppjs-<platform> sidecars contain MPXJ and are LGPL-2.1-or-later. Each sidecar package includes the LGPL text and a NOTICE pointing to the upstream source.

The wrapper invokes the binary as a subprocess; LGPL obligations are contained to the sidecar packages.

版本与发布记录

@byteink/mppjs 共发布 5 个版本,首次发布于 2026/05/09;过去 12 个月发布了 5 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.8latest2026/09/181 个月前
0.1.72026/09/032 个月前
0.1.62026/08/222 个月前
0.1.52026/05/096 个月前
0.1.42026/05/096 个月前

关于 @byteink/mppjs 的常见问题

@byteink/mppjs 是什么?

Convert Microsoft Project (.mpp) files to XML from Node, Bun, or Deno. Native binary, no JVM required.

如何安装 @byteink/mppjs?

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

@byteink/mppjs 支持 TypeScript 吗?

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

@byteink/mppjs 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@byteink/mppjs 需要什么版本的 Node.js?

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

@byteink/mppjs 可以商用吗?

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

@byteink/mppjs 的下载量有多少?

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

@byteink/mppjs 还在维护吗?

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