@blit-sh/bin

中文文档
0.55.1发布于 2026/08/21MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 3.9万

Installs the prebuilt blit binary for your platform; default export is the binary path.

原始使用文档
文档目录8 节
  1. CLI
  2. Bundle the binary in your own tool
  3. ESM
  4. CommonJS
  5. Helpers
  6. Platforms
  7. GPL flavor
  8. License

@blit-sh/bin

The blit binary, distributed via npm. Installing @blit-sh/bin pulls in exactly one prebuilt package for your platform (@blit-sh/bin-<os>-<cpu>[-musl]) through optional dependencies — nothing else.

CLI

npm i -g @blit-sh/bin
blit open

Bundle the binary in your own tool

The default export is the absolute filesystem path to the blit executable, so you can spawn it directly. Resolution happens on import and throws with an actionable message if the matching prebuilt package was not installed.

ESM

import blit from "@blit-sh/bin";
import { spawn } from "node:child_process";

spawn(blit, ["open"], { stdio: "inherit" });

CommonJS

const blit = require("@blit-sh/bin");
const { spawn } = require("node:child_process");

spawn(blit, ["open"], { stdio: "inherit" });

Helpers

Lower-level resolution helpers are available on the @blit-sh/bin/resolve subpath (and as named exports of the main entry):

import {
  binaryPath,
  binaryName,
  candidatePackages,
  isMusl,
} from "@blit-sh/bin";
// or: import { binaryPath } from "@blit-sh/bin/resolve";
exportdescription
defaultabsolute path to the blit binary (resolved at import)
binaryPath()same path, computed lazily; throws if unavailable
binaryName()"blit" or "blit.exe"
candidatePackages()platform package names, in resolution order
isMusl()true on musl-libc Linux

Platforms

Linux x64/arm64 (glibc & musl), macOS arm64, Windows x64 — matching the binaries the blit release pipeline builds.

GPL flavor

@blit-sh/bin-gpl ships the same build with x264 (GPL-2.0-or-later) instead of openh264 for software H.264: better compression, and 4:4:4 rather than 4:2:0. Linux only, same API, no blit CLI shim so it installs alongside this package.

License

MIT

版本与发布记录

@blit-sh/bin 共发布 39 个版本,首次发布于 2026/06/12;过去 12 个月发布了 39 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.55.1latest2026/08/212 个月前
0.55.02026/08/212 个月前
0.54.02026/08/202 个月前
0.53.22026/08/182 个月前
0.53.02026/08/172 个月前
0.52.02026/08/142 个月前

关于 @blit-sh/bin 的常见问题

@blit-sh/bin 是什么?

Installs the prebuilt blit binary for your platform; default export is the binary path.

如何安装 @blit-sh/bin?

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

@blit-sh/bin 支持 TypeScript 吗?

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

@blit-sh/bin 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@blit-sh/bin 需要什么版本的 Node.js?

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

@blit-sh/bin 可以商用吗?

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

@blit-sh/bin 的下载量有多少?

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

@blit-sh/bin 还在维护吗?

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