thermal-label/labelmanager
GitHub: thermal-label/labelmanager
一个TypeScript驱动的DYMO LabelManager D1标签打印机套件,支持Node.js、浏览器和CLI环境打印。
Stars: 0 | Forks: 0
# @thermal-label/labelmanager
[](https://github.com/thermal-label/labelmanager/actions/workflows/ci.yml)
[](https://codecov.io/gh/thermal-label/labelmanager)
[](https://npmjs.com/package/@thermal-label/labelmanager-core)
[](https://npmjs.com/package/@thermal-label/labelmanager-node)
[](https://npmjs.com/package/@thermal-label/labelmanager-web)
[](LICENSE)
## 安装
```
pnpm add @thermal-label/labelmanager-node # Node USB
pnpm add @thermal-label/labelmanager-web # Browser WebUSB
```
如需从终端临时打印,请安装
[`thermal-label-cli`](https://www.npmjs.com/package/thermal-label-cli) — 它
能自动检测所有已安装的驱动程序,无需为每个驱动程序单独安装 CLI。
## Node 快速示例
```
import { discovery } from '@thermal-label/labelmanager-node';
import { TAPE_12MM } from '@thermal-label/labelmanager-core';
const printer = await discovery.openPrinter();
try {
// image is RawImageData — { width, height, data } where data is RGBA bytes.
await printer.print(image, TAPE_12MM);
} finally {
await printer.close();
}
```
## 浏览器快速示例
```
import { requestPrinter } from '@thermal-label/labelmanager-web';
import { TAPE_12MM } from '@thermal-label/labelmanager-core';
const printer = await requestPrinter(); // call from a user gesture
try {
await printer.print(image, TAPE_12MM);
} finally {
await printer.close();
}
```
## 支持的硬件
**8 台设备** — 1 台已验证 · 0 台部分支持 · 1 台不可用 · 6 台未测试
| 型号 | 标识符 | USB PID | 传输方式 | 状态 |
| --- | --- | --- | --- | --- |
| [LabelManager 280](https://thermal-label.github.io/hardware/labelmanager/lm-280) | `LM_280` | 0x1006 | USB | ⏳ 未测试 |
| [LabelManager 400](https://thermal-label.github.io/hardware/labelmanager/lm-400) | `LM_400` | 0x0013 | USB | ⏳ 未测试 |
| [LabelManager 420P](https://thermal-label.github.io/hardware/labelmanager/lm-420p) | `LM_420P` | 0x1004 | USB | ⏳ 未测试 |
| [LabelManager PC](https://thermal-label.github.io/hardware/labelmanager/lm-pc) | `LM_PC` | 0x0011 | USB | ⏳ 未测试 |
| [LabelManager PnP](https://thermal-label.github.io/hardware/labelmanager/lm-pnp) | `LM_PNP` | 0x1002 | USB | ✅ 已验证 |
| [LabelManager Wireless PnP](https://thermal-label.github.io/hardware/labelmanager/lm-wireless-pnp) | `LM_WIRELESS_PNP` | 0x1008 | USB | ⏳ 未测试 |
| [LabelPoint 350](https://thermal-label.github.io/hardware/labelmanager/labelpoint-350) | `LABELPOINT_350` | 0x0015 | USB | ⏳ 未测试 |
| [MobileLabeler](https://thermal-label.github.io/hardware/labelmanager/mobile-labeler) | `MOBILE_LABELER` | 0x1009 | USB | ❌ 不可用 |
点击任意型号可打开其文档站点的详情页面,那里有引擎、支持的介质和验证报告。相同的数据支撑着[交互式跨驱动程序表格](https://thermal-label.github.io/hardware/)。
## 文档
完整文档位于 ** **。
- [快速入门](https://thermal-label.github.io/labelmanager/getting-started)
- [硬件列表](https://thermal-label.github.io/labelmanager/hardware)
- [D1 磁带协议](https://thermal-label.github.io/d1-core/protocol)(与 `@thermal-label/d1-core` 中的 LabelWriter Duo 共享)
- [Node 指南](https://thermal-label.github.io/labelmanager/node)
- [Web 指南](https://thermal-label.github.io/labelmanager/web)
- [API 参考](https://thermal-label.github.io/labelmanager/api/)
- [在线演示](https://thermal-label.github.io/demo/labelmanager)
## 软件包
| 包名 | 作用 |
|---|---|
| `@thermal-label/labelmanager-core` | 协议编码、设备与介质注册表。支持浏览器和 Node。 |
| `@thermal-label/labelmanager-node` | Node USB 传输层。 |
| `@thermal-label/labelmanager-web` | 浏览器 WebUSB 传输层。 |
各个驱动程序对应的 `*-cli` 包已退役 — 请改用统一的
[`thermal-label-cli`](https://www.npmjs.com/package/thermal-label-cli)。
## 兼容性
| | |
|---|---|
| Node | ≥ 20.9(推荐 Node 24 LTS) |
| 浏览器 | Chrome / Edge 89+,安全上下文(`https://` 或 `localhost`) |
| Linux | 通常需要为 `0922:*` 添加 `udev` 规则;首次运行配置可能需要 `usb_modeswitch` |
| 设备 | DYMO LabelManager(D1 磁带)— 详见硬件列表 |
| 依赖项 | `@thermal-label/contracts`、`@thermal-label/transport`、`@mbtech-nl/bitmap` |
| 许可证 | MIT |
与 DYMO 无关联。商标归其所有者所有。
## 贡献指南
请查阅该组织 `.github` 仓库中的 [`CONTRIBUTING/`](https://github.com/thermal-label/.github/tree/main/CONTRIBUTING)。
标签:MITM代理, Node.js平台, npm包管理, TypeScript开发, USB通信, WebUSB接口, 办公自动化, 命令行界面, 打印技术, 文档结构分析, 标签打印机, 浏览器打印, 物联网设备, 硬件驱动, 自动化攻击, 设备驱动程序, 软件开发