@qumra/webserial
v0.1.2
Published
Connect to thermal printers via WebSerial (a web alternative for serial ports) — early scaffold
Readme
@qumra/webserial
Connect to thermal printers over Web Serial in the browser.
Part of the @qumra suite. A web alternative to @qumra/webusb for setups that expose a serial port — such as the virtual COM port created by the printer driver on Windows (where WebUSB fails).
🚧 Early scaffold. The interface is defined and mirrors
@qumra/webusb; the full implementation is on the roadmap. Callingconnect()/print()currently throws"قيد التطوير"(under development).
Installation
npm install @qumra/webserialPlanned interface
import { QumraWebSerialPrinter } from '@qumra/webserial';
const printer = new QumraWebSerialPrinter({ baudRate: 9600 });
await printer.connect(); // opens a serial-port chooser
await printer.print(bytes);| Method | Status | Description |
|---|---|---|
| connect() | 🚧 in progress | Opens a serial port and connects. |
| print(bytes) | 🚧 in progress | Sends Uint8Array \| number[]. |
| disconnect() | ✅ | Closes the port. |
| baudRate | ✅ | Port speed (getter, default 9600). |
Requirements
- Web Serial support: Chrome / Edge.
- On Electron, prefer @qumra/node-usb — stronger and simpler than Web Serial for USB printers on Windows.
Related packages
- @qumra/webusb — the primary browser transport.
- @qumra/node-usb — the Node-side (Windows-friendly) transport.
License
MIT © Qumra
