本版亮点 / Highlights
- 新增可直接使用的 Node CLI:主命令
sk,同时保留 shotkit 别名,支持 npx 与全局安装。
- Release 自动附带六个平台归档与中英文说明;新增独立 Node SDK CI、类型检查和 npm 缓存。
- README 重构为英文主文档与简体中文版,补齐安装和命令行示例。
# ShotKit v0.1.2 **Turn HTML into PNG / WebP — without a browser.** [](https://www.npmjs.com/package/@shotkit/node) [](https://github.com/sj817/shotkit#readme) [](https://github.com/sj817/shotkit/blob/v0.1.2/README.zh-CN.md)
## Install ```bash npm install @shotkit/node ``` > [!TIP] > npm resolves exactly one prebuilt runtime for your platform. No node-gyp, no > compiler, and no post-install download.
Other ways to run it
```bash # One-off, no install npx @shotkit/node --url https://example.com --out shot.png # Global CLI — installs as `sk`, with `shotkit` as an equivalent alias npm install -g @shotkit/node sk --html page.html --out page.png --full-page # Node.js API node -e "const {launch}=require('@shotkit/node');launch().then(async s=>{await s.screenshotURL('https://example.com',{outputPath:'a.png'});await s.close()})" ``` ## Prebuilt runtimes Standalone archives for the CLI, the C ABI, and non-Node languages. Extract completely before use. | Platform | Arch | npm package | Archive | Size | SHA-256 | |---|---|---|---|--:|---| | Windows | x64 | `@shotkit/win32-x64` | [`shotkit-0.1.2-windows-x64.tar.xz`](https://github.com/sj817/shotkit/releases/download/v0.1.2/shotkit-0.1.2-windows-x64.tar.xz) | 11.5 MB | `e31bdbb57ff81b77…` | | Windows | arm64 | `@shotkit/win32-arm64` | [`shotkit-0.1.2-windows-arm64.tar.xz`](https://github.com/sj817/shotkit/releases/download/v0.1.2/shotkit-0.1.2-windows-arm64.tar.xz) | 10.6 MB | `2fd136c30d9f8647…` | | Linux | x64 | `@shotkit/linux-x64` | [`shotkit-0.1.2-linux-x64.tar.xz`](https://github.com/sj817/shotkit/releases/download/v0.1.2/shotkit-0.1.2-linux-x64.tar.xz) | 9.1 MB | `0453a89ebee508dd…` | | Linux | arm64 | `@shotkit/linux-arm64` | [`shotkit-0.1.2-linux-arm64.tar.xz`](https://github.com/sj817/shotkit/releases/download/v0.1.2/shotkit-0.1.2-linux-arm64.tar.xz) | 8.2 MB | `88c6f266d832d75c…` | | macOS | x64 (Intel) | `@shotkit/darwin-x64` | [`shotkit-0.1.2-macos-x64.tar.xz`](https://github.com/sj817/shotkit/releases/download/v0.1.2/shotkit-0.1.2-macos-x64.tar.xz) | 9.6 MB | `505ed150e8439113…` | | macOS | arm64 (Apple silicon) | `@shotkit/darwin-arm64` | [`shotkit-0.1.2-macos-arm64.tar.xz`](https://github.com/sj817/shotkit/releases/download/v0.1.2/shotkit-0.1.2-macos-arm64.tar.xz) | 8.1 MB | `cd588f366e1a2f55…` |
Verify a download
```bash # Linux / macOS sha256sum -c shotkit-0.1.2-linux-x64.tar.xz.sha256 # Windows (PowerShell) (Get-FileHash shotkit-0.1.2-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: - [x] PNG and WebP screenshot smoke tests - [x] Page scripts are never fetched or executed - [x] Exactly 10 `shot_*` C ABI exports - [x] Relocatable CLI (`$ORIGIN/../lib` / `@loader_path/../lib`) - [x] Release archive within its size budget Published to npm through [Trusted Publishing (OIDC)](https://docs.npmjs.com/trusted-publishers) — no long-lived token is involved. ---
🇨🇳 简体中文
### 安装 ```bash npm install @shotkit/node ``` npm 只会为当前平台装下唯一匹配的预编译运行时——不需要 node-gyp,不需要编译器,也没有安装后下载。 ```bash # 不安装,直接跑一次 npx @shotkit/node --url https://example.com --out shot.png # 全局 CLI —— 命令为 `sk`,同时提供等价别名 `shotkit` npm install -g @shotkit/node sk --html page.html --out page.png --full-page ``` ### 预编译运行时 上面的归档表供 CLI、C ABI 和非 Node 语言直接使用,**请完整解压后再运行**。 布局按平台不同:Windows 是平铺的 `shotcli.exe`、`shot.dll`、`include/shot.h`, 外加一份逐文件带 SHA-256 的 `manifest.json`;Linux 与 macOS 则是 `bin/`、`lib/`、 `include/`,另有 `DEPENDENCIES.txt`。 校验下载: ```bash # Linux / macOS sha256sum -c shotkit-0.1.2-linux-x64.tar.xz.sha256 ``` ### CI 验证项 本次发布的每个运行时,都在其对应的平台与架构上通过了:PNG/WebP 截图冒烟测试、 页面脚本零请求零执行、10 个 `shot_*` C ABI 导出、可重定位 CLI、以及发布归档体积闸门。 npm 侧通过 Trusted Publishing(OIDC)发布,全程不涉及长期有效的 token。 **Full changelog**: https://github.com/sj817/shotkit/compare/v0.1.1...v0.1.2