thermal-label/brother-ql
GitHub: thermal-label/brother-ql
一个用TypeScript编写的跨平台Brother QL热敏标签打印机驱动库,旨在通过Node.js和浏览器WebUSB技术简化标签打印的自动化与集成。
Stars: 0 | Forks: 0
# @热敏标签/brother-ql
[](https://github.com/thermal-label/brother-ql/actions/workflows/ci.yml)
[](https://codecov.io/gh/thermal-label/brother-ql)
[](https://npmjs.com/package/@thermal-label/brother-ql-core)
[](https://npmjs.com/package/@thermal-label/brother-ql-node)
[](https://npmjs.com/package/@thermal-label/brother-ql-web)
[](LICENSE)
## 安装
```
pnpm add @thermal-label/brother-ql-node # Node USB/TCP
pnpm add @thermal-label/brother-ql-web # Browser WebUSB
```
若要进行临时的终端打印,请安装
[`thermal-label-cli`](https://www.npmjs.com/package/thermal-label-cli) —— 它可以
自动检测所有已安装的驱动程序,无需为每个驱动程序单独使用命令行工具。
## 快速示例 (Node, USB)
```
import { discovery } from '@thermal-label/brother-ql-node';
import { MEDIA } from '@thermal-label/brother-ql-core';
const printer = await discovery.openPrinter();
try {
// `image` is RawImageData — { width, height, data } where data is
// an RGBA Uint8Array. Any pipeline that produces RGBA works.
await printer.print(image, MEDIA[259]); // 62mm continuous
} finally {
await printer.close();
}
```
## 快速示例 (浏览器, WebUSB)
```
import { requestPrinter } from '@thermal-label/brother-ql-web';
import { MEDIA } from '@thermal-label/brother-ql-core';
const printer = await requestPrinter(); // call from a user gesture
try {
await printer.print(image, MEDIA[259]);
} finally {
await printer.close();
}
```
## 支持的硬件
**24 种设备** — 1 已验证 · 0 部分支持 · 17 预期支持 · 0 不支持 · 6 未验证
| 型号 | 键 | USB PID | 传输方式 | 状态 |
| --- | --- | --- | --- | --- |
| [PT-E550W](https://thermal-label.github.io/hardware/brother-ql/pt-e550w) | `PT_E550W` | 0x2060 | USB, TCP | ⏳ 未验证 |
| [PT-P750W](https://thermal-label.github.io/hardware/brother-ql/pt-p750w) | `PT_P750W` | 0x2062 | USB, TCP | ⏳ 未验证 |
| [PT-P900](https://thermal-label.github.io/hardware/brother-ql/pt-p900) | `PT_P900` | 0x2083 | USB | ⏳ 未验证 |
| [PT-P900W](https://thermal-label.github.io/hardware/brother-ql/pt-p900w) | `PT_P900W` | 0x2085 | USB, TCP | ⏳ 未验证 |
| [PT-P910BT](https://thermal-label.github.io/hardware/brother-ql/pt-p910bt) | `PT_P910BT` | 0x20c7 | USB, BT SPP | ⏳ 未验证 |
| [PT-P950NW](https://thermal-label.github.io/hardware/brother-ql/pt-p950nw) | `PT_P950NW` | 0x2086 | USB, TCP | ⏳ 未验证 |
| [QL-500](https://thermal-label.github.io/hardware/brother-ql/ql-500) | `QL_500` | 0x2013 | USB | 🔄 预期支持 |
| [QL-550](https://thermal-label.github.io/hardware/brother-ql/ql-550) | `QL_550` | 0x2016 | USB | 🔄 预期支持 |
| [QL-560](https://thermal-label.github.io/hardware/brother-ql/ql-560) | `QL_560` | 0x2018 | USB | 🔄 预期支持 |
| [QL-570](https://thermal-label.github.io/hardware/brother-ql/ql-570) | `QL_570` | 0x2019 | USB | 🔄 预期支持 |
| [QL-580N](https://thermal-label.github.io/hardware/brother-ql/ql-580n) | `QL_580N` | 0x201b | USB, TCP | 🔄 预期支持 |
| [QL-600](https://thermal-label.github.io/hardware/brother-ql/ql-600) | `QL_600` | 0x2100 | USB | 🔄 预期支持 |
| [QL-650TD](https://thermal-label.github.io/hardware/brother-ql/ql-650td) | `QL_650TD` | 0x201c | USB | 🔄 预期支持 |
| [QL-700](https://thermal-label.github.io/hardware/brother-ql/ql-700) | `QL_700` | 0x2042 | USB | 🔄 预期支持 |
| [QL-710W](https://thermal-label.github.io/hardware/brother-ql/ql-710w) | `QL_710W` | 0x2044 | USB, TCP | 🔄 预期支持 |
| [QL-720NW](https://thermal-label.github.io/hardware/brother-ql/ql-720nw) | `QL_720NW` | 0x2045 | USB, TCP | 🔄 预期支持 |
| [QL-800](https://thermal-label.github.io/hardware/brother-ql/ql-800) | `QL_800` | 0x209b | USB | 🔄 预期支持 |
| [QL-810W](https://thermal-label.github.io/hardware/brother-ql/ql-810w) | `QL_810W` | 0x209c | USB, TCP | 🔄 预期支持 |
| [QL-820NWBc](https://thermal-label.github.io/hardware/brother-ql/ql-820nwbc) | `QL_820NWBc` | 0x209d | USB, TCP, BT SPP | ✅ 已验证 |
| [QL-1050](https://thermal-label.github.io/hardware/brother-ql/ql-1050) | `QL_1050` | 0x2027 | USB | 🔄 预期支持 |
| [QL-1060N](https://thermal-label.github.io/hardware/brother-ql/ql-1060n) | `QL_1060N` | 0x2028 | USB, TCP | 🔄 预期支持 |
| [QL-1100](https://thermal-label.github.io/hardware/brother-ql/ql-1100) | `QL_1100` | 0x20a7 | USB | 🔄 预期支持 |
| [QL-1110NWB](https://thermal-label.github.io/hardware/brother-ql/ql-1110nwb) | `QL_1110NWB` | 0x20a8 | USB, TCP | 🔄 预期支持 |
| [QL-1115NWB](https://thermal-label.github.io/hardware/brother-ql/ql-1115nwb) | `QL_1115NWB` | 0x20ab | USB, TCP | 🔄 预期支持 |
点击任何型号可在文档网站上打开其详细页面,其中包含引擎、支持的介质和验证报告。相同的数据支撑着[交互式跨驱动程序表格](https://thermal-label.github.io/hardware/)。
## 文档
完整文档请访问 ** **。
- [快速入门](https://thermal-label.github.io/brother-ql/getting-started)
- [硬件列表](https://thermal-label.github.io/brother-ql/hardware)
- [介质 + DK 卷筒参考](https://thermal-label.github.io/brother-ql/media)
- [协议参考](https://thermal-label.github.io/brother-ql/protocol/) — [QL 光栅](https://thermal-label.github.io/brother-ql/protocol/ql) · [PT 光栅](https://thermal-label.github.io/brother-ql/protocol/pt)
- [故障排除](https://thermal-label.github.io/brother-ql/troubleshooting)
- [API 参考](https://thermal-label.github.io/brother-ql/api/)
- [在线演示](https://thermal-label.github.io/demo/brother-ql)
## 软件包
| 软件包 | 角色 |
|---|---|
| `@thermal-label/brother-ql-core` | 协议编码、设备与媒体注册表。支持浏览器和Node环境。 |
| `@thermal-label/brother-ql-node` | Node USB (libusb) 和 TCP (端口 9100) 传输。 |
| `@thermal-label/brother-ql-web` | 浏览器 WebUSB 传输。 |
独立的 `*-cli` 包已停用 — 请改用统一的
[`thermal-label-cli`](https://www.npmjs.com/package/thermal-label-cli)。
## 兼容性
| | |
|---|---|
| Node | ≥ 20.9 (推荐 Node 24 LTS) |
| 浏览器 | Chrome / Edge 89+ (WebUSB),安全上下文 (`https://` 或 `localhost`) |
| Linux | 通常需要为 `04F9:*` 设置 `udev` 规则才能在没有 `sudo` 的情况下访问 |
| 依赖 | `@thermal-label/contracts`, `@thermal-label/transport`, `@mbtech-nl/bitmap` |
| 许可证 | MIT |
与 Brother 公司无关。商标属于其各自所有者。
## 贡献指南
请参阅 [`CONTRIBUTING/`](https://github.com/thermal-label/.github/tree/main/CONTRIBUTING)
在组织 `.github` 仓库中 — 行为准则、安全策略、“添加驱动程序”指南、发布流程。
标签:Brother QL, CLI, GNU通用公共许可证, MITM代理, MIT 许可, Node.js, npm 包, TCP, TypeScript, USB, WebUSB, WiFi技术, 命令行界面, 安全插件, 打印功能, 打印机控制, 标签打印, 标签打印机, 浏览器打印, 热敏打印, 硬件驱动, 自动化攻击, 驱动程序套件