@thermal-label/brother-ql-node
v0.3.0
Published
Node.js USB and TCP driver for Brother QL label printers
Downloads
380
Maintainers
Readme
@thermal-label/brother-ql-node
Node.js USB and TCP driver for Brother QL label printers.
Install
pnpm add @thermal-label/brother-ql-nodeFor image file support (PNG/JPEG), also install:
pnpm add @napi-rs/canvasQuick Start
import { openPrinter, MEDIA } from '@thermal-label/brother-ql-node';
const printer = await openPrinter();
await printer.printText('Hello QL', MEDIA[259]!);
await printer.close();Discover Printers
import { listPrinters } from '@thermal-label/brother-ql-node';
const printers = listPrinters();
console.log(printers);Print an Image
await printer.printImage('/path/to/image.png', MEDIA[259]!);Two-Color Printing (QL-800 series)
import { openPrinter, MEDIA, renderText } from '@thermal-label/brother-ql-node';
import { createBitmap } from '@mbtech-nl/bitmap';
const printer = await openPrinter();
const media = MEDIA[259]!;
const black = renderText('Hello', { scaleX: 2, scaleY: 2 });
const red = renderText('World', { scaleX: 2, scaleY: 2 });
await printer.printTwoColor(black, red, media);
await printer.close();TCP/Network Printing
import { openPrinterTcp, MEDIA } from '@thermal-label/brother-ql-node';
const printer = await openPrinterTcp('192.168.1.100');
await printer.printText('Hello Network', MEDIA[259]!);
await printer.close();Requirements
- Node.js
>=24.0.0 - Linux: add a udev rule for raw USB access without
sudo:SUBSYSTEM=="usb", ATTRS{idVendor}=="04f9", MODE="0666" @napi-rs/canvasis optional — required only for image file decoding
License
MIT © Mannes Brak
