Skip to content

v0.3.1

Choose a tag to compare

@sj817 sj817 released this 11 Sep 07:25
v0.3.1
70f574e

ShotKit v0.3.1

Turn HTML into PNG / WebP — without a browser.

npm
docs
中文

Changes

  • feat(node): 实现基于 C API 的原生截图绑定
  • fix(capi): 使用标准移动交接编码缓冲区
  • fix(ci): 允许 Node 宿主符号并拆分 macOS 压测
  • fix(node): 由发布流程统一注入包版本
  • fix(threading): 支持宿主专用渲染线程
  • fix(threading): 在线程退出前清理 WebCore 状态
  • ci(node): 发布可安装的 PR 原生预览包
  • feat(render): 支持透明截图画布
  • test(node): 修正透明图片数据断言
  • chore(node): 同步主包版本至零点三
  • ci(linux): 串行化完整链接以降低峰值
  • test(node): 稳定端到端性能门槛
  • test(node): 修正性能回归判定语义
  • ci(node): 移除阻断式性能微基准
  • fix(release): npm成功后再公开完整发行版
  • docs(release): 自动生成版本变更摘要
  • chore(repo): 移除Shot构建不可达的上游目录 (#5)
  • feat(npm): 迁到 @pixel.js 组织,旧包名 @shotkit/node 以兼容别名同版本继续发布 (#6)

Install

npm install @pixel.js/shotkit

Tip

npm resolves exactly one prebuilt runtime for your platform. No node-gyp, no
compiler, and no post-install download.

Also published as @shotkit/node@0.3.1, the previous name: a compatibility
alias that depends on this package. Existing installs keep updating unchanged.

Other ways to run it
# Node.js API
node -e "const {launch}=require('@pixel.js/shotkit');launch().then(async s=>{await s.screenshotURL('https://example.com',{outputPath:'a.png'});await s.close()})"

# Standalone CLI: download the matching GitHub Release archive below.
./shotkit-linux-x64/bin/shotcli --url https://example.com --out shot.png

Prebuilt runtimes

Standalone archives for the CLI, the C ABI, and non-Node languages. Extract completely before use —
each one unpacks into a version-free shotkit-<os>-<arch>/ directory.

Platform Arch npm package Archive Size SHA-256
Windows x64 @pixel.js/shotkit-win32-x64 shotkit-0.3.1-windows-x64.tar.xz 11.5 MB 5f0b17600d208204…
Windows arm64 @pixel.js/shotkit-win32-arm64 shotkit-0.3.1-windows-arm64.tar.xz 10.7 MB 600cb78f33f838ab…
Linux x64 @pixel.js/shotkit-linux-x64 shotkit-0.3.1-linux-x64.tar.xz 9.2 MB 1bb051389d7cbb4c…
Linux arm64 @pixel.js/shotkit-linux-arm64 shotkit-0.3.1-linux-arm64.tar.xz 8.3 MB 03e478981011f5b3…
macOS x64 (Intel) @pixel.js/shotkit-darwin-x64 shotkit-0.3.1-macos-x64.tar.xz 9.7 MB 8311613e938e3c2d…
macOS arm64 (Apple silicon) @pixel.js/shotkit-darwin-arm64 shotkit-0.3.1-macos-arm64.tar.xz 8.2 MB f90d8bca2062a212…
Verify a download
# Linux / macOS
sha256sum -c shotkit-0.3.1-linux-x64.tar.xz.sha256

# Windows (PowerShell)
(Get-FileHash shotkit-0.3.1-windows-x64.tar.xz -Algorithm SHA256).Hash

Layout differs by platform: Windows archives are flat — shotcli.exe, shot.dll,
include/shot.h, and a manifest.json listing every file with its own SHA-256.
Linux and macOS use bin/, lib/, include/, plus a DEPENDENCIES.txt.

Verified in CI

Every runtime in this release passed, on its own platform and architecture:

  • PNG and WebP screenshot smoke tests
  • Page scripts are never fetched or executed
  • Exactly 10 shot_* C ABI exports
  • Native shot.node uses one N-API v8 build and does not export shot_*
  • Relocatable CLI ($ORIGIN/../lib / @loader_path/../lib)
  • Release archive within its size budget

Published to npm through Trusted Publishing (OIDC) — no
long-lived token is involved.


🇨🇳 简体中文

安装

npm install @pixel.js/shotkit

npm 只会为当前平台装下唯一匹配的预编译运行时——不需要 node-gyp,不需要编译器,也没有安装后下载。
同时以旧包名 @shotkit/node@0.3.1 发布为兼容别名包,依赖本包;已有项目无需改动。

# Node.js API
node -e "const {launch}=require('@pixel.js/shotkit');launch().then(async s=>{await s.screenshotURL('https://example.com',{outputPath:'a.png'});await s.close()})"

# 独立 CLI 请下载下方对应平台的 GitHub Release 归档
./shotkit-linux-x64/bin/shotcli --url https://example.com --out shot.png

预编译运行时

上面的归档表供 CLI、C ABI 和非 Node 语言直接使用,请完整解压后再运行。
每个归档解压出的目录都是不带版本号的 shotkit-<os>-<arch>/。
布局按平台不同:Windows 是平铺的 shotcli.exe、shot.dll、include/shot.h,
外加一份逐文件带 SHA-256 的 manifest.json;Linux 与 macOS 则是 bin/、lib/、
include/,另有 DEPENDENCIES.txt。

校验下载:

# Linux / macOS
sha256sum -c shotkit-0.3.1-linux-x64.tar.xz.sha256

CI 验证项

本次发布的每个运行时,都在其对应的平台与架构上通过了:PNG/WebP 截图冒烟测试、
页面脚本零请求零执行、10 个 shot_* C ABI 导出、原生 shot.node 导出面、
可重定位 CLI、以及发布归档体积闸门。

npm 侧通过 Trusted Publishing(OIDC)发布,全程不涉及长期有效的 token。

Full changelog: v0.2.1...v0.3.1