Shared D1 tape protocol primitives — wire-format encoder, status-byte parser, and tape-type / colour-palette tables — for the DYMO LabelManager and DYMO LabelWriter Duo (tape side) drivers.
The D1 vocabulary is ESC A..E plus SYN (per the LW 400 Series Tech
Ref and on-the-wire analysis). Both the standalone LabelManager chassis
and the LabelWriter Duo's tape engine speak the same protocol with the
same 1-byte status reply; this package centralises the encoder so both
drivers stay byte-for-byte aligned. The 8-byte status reply that some
DYMO firmware references belongs to the Duo's label-side
lw-450 engine on a separate endpoint and is not D1.
pnpm add @thermal-label/d1-coreMost users won't depend on this package directly — install the runtime-flavoured LabelManager or LabelWriter driver instead, which re-exports the relevant surface.
import {
buildPrinterStream,
parseStatus,
STATUS_REQUEST,
tapeTypeFor,
} from '@thermal-label/d1-core';
// engine + media come from the driver's DEVICES + MEDIA tables.
const stream = buildPrinterStream(bitmap, engine, options, media);
// Ship `stream` over the transport. Then poll status:
const reply = await transport.exchange(STATUS_REQUEST);
const status = parseStatus(reply);buildPrinterStream(bitmap, engine, options, media)— encode a print job to a contiguous USB Printer-class byte stream.parseStatus(bytes)+STATUS_REQUEST— single-byte D1 status decoder. Same shape on every D1 device.tapeTypeFor(media)+TAPE_TYPE_DEFAULT/TAPE_TYPE_MAX— map a user-selected media'stext/backgroundcolours to theESC C nselector (0..12) per LW 400 Series Tech Ref p.24. Host-declared: D1 firmware detects cassette presence but not type.
@thermal-label/labelmanager-core— standalone LabelManager handheld chassis.@thermal-label/labelwriter-core— LabelWriter Duo composite (tape side).
https://thermal-label.github.io/d1-core/
MIT