@bentopdf/gs-wasm

中文文档
0.1.1发布于 2026/01/20AGPL-3.0-onlyTypeScriptES Module近 30 天下载 2965

Ghostscript compiled to WebAssembly for BentoPDF

原始使用文档
文档目录7 节
  1. Notice
  2. Attribution
  3. Source Code Availability
  4. Build Instructions
  5. License
  6. Installation
  7. Usage

@bentopdf/gs-wasm

Ghostscript compiled to WebAssembly.

Notice

This package is a modified version of Ghostscript, originally developed by Artifex Software, Inc.

It has been adapted for WebAssembly (WASM).

Attribution

Ghostscript is copyright © Artifex Software, Inc. This package is distributed under the GNU Affero General Public License v3.0.

This project is not affiliated with or endorsed by Artifex Software, Inc.

Source Code Availability

This program is licensed under the GNU Affero General Public License v3.0. If you interact with this program over a network, you are entitled to receive the complete corresponding source code.

The source code for this package is available at: https://github.com/alam00000/bentopdf-gs-wasm

This package includes the complete Corresponding Source (build scripts and configuration) in the build_scripts/ directory.

Build Instructions

To rebuild the WASM binary from source:

  1. Download the source code from the repository or this package.
  2. Navigate to the build_scripts/ directory.
  3. Follow the instructions in build_scripts/README.md.

License

This project is licensed under the AGPL-3.0-only license.

Installation

npm install @bentopdf/gs-wasm

Usage

import { loadGhostscriptWASM } from '@bentopdf/gs-wasm';

const gs = await loadGhostscriptWASM({
    // Optional: Configure CDN loading
    baseUrl: 'https://cdn.jsdelivr.net/npm/@bentopdf/[email protected]/assets/'
});

版本与发布记录

@bentopdf/gs-wasm 共发布 2 个版本,首次发布于 2025/12/25;过去 12 个月发布了 2 个版本。

版本发布日期距今
0.1.1latest2026/01/209 个月前
0.1.02025/12/2510 个月前

关于 @bentopdf/gs-wasm 的常见问题

@bentopdf/gs-wasm 是什么?

Ghostscript compiled to WebAssembly for BentoPDF

如何安装 @bentopdf/gs-wasm?

在项目目录运行 npm install @bentopdf/gs-wasm,或使用 pnpm add / yarn add / bun add。

@bentopdf/gs-wasm 支持 TypeScript 吗?

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

@bentopdf/gs-wasm 支持 ESM 还是 CommonJS?

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

@bentopdf/gs-wasm 可以商用吗?

@bentopdf/gs-wasm 使用 AGPL-3.0-only 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@bentopdf/gs-wasm 的下载量有多少?

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

@bentopdf/gs-wasm 还在维护吗?

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