TypeScript-first toolkit to interact with DYMO LabelWriter printers via the DYMO Web Service.
- Typed helpers - XML request/response handling with full TypeScript support
- React hooks - Easy integration with React applications
- Abortable requests - Cancel pending requests with AbortController
- Printer discovery - Enumerate available DYMO printers
- Label preview - Render labels as PNG images before printing
| Package | Description | Docs |
|---|---|---|
| @dymo-print-suite/core | TypeScript utilities (no React dependency) | README |
| @dymo-print-suite/react | React hooks + re-exports from core | README |
For React projects:
npm install @dymo-print-suite/react
# or
pnpm add @dymo-print-suite/reactFor non-React projects:
npm install @dymo-print-suite/core
# or
pnpm add @dymo-print-suite/coreimport {
useDymoCheckService,
useDymoFetchPrinters,
printLabel,
} from "@dymo-print-suite/react";
const labelXml = `<?xml version="1.0" encoding="utf-8"?>
<DieCutLabel Version="8.0" Units="twips">
<PaperOrientation>Landscape</PaperOrientation>
<ObjectInfo Name="Text">
<TextObject>
<StyledText><String>Hello World</String></StyledText>
</TextObject>
</ObjectInfo>
</DieCutLabel>`;
function App() {
const status = useDymoCheckService();
const { printers, statusFetchPrinters } = useDymoFetchPrinters(status);
if (status === "loading") return <p>Checking DYMO service...</p>;
if (status === "error") return <p>DYMO service not available</p>;
return (
<div>
<h1>Available Printers</h1>
{statusFetchPrinters === "success" && (
<ul>
{printers.map((p) => (
<li key={p.name}>
{p.name}
<button onClick={() => printLabel(p.name, labelXml)}>
Print
</button>
</li>
))}
</ul>
)}
</div>
);
}import { dymoRequestBuilder, printLabel } from "@dymo-print-suite/core";
// Check service status
const response = await dymoRequestBuilder({
method: "GET",
wsAction: "status",
});
// Print a label
await printLabel("DYMO LabelWriter 450", labelXml);If you were using react-dymo-hooks, update your imports:
- import { useDymoCheckService, printLabel } from "react-dymo-hooks";
+ import { useDymoCheckService, printLabel } from "@dymo-print-suite/react";The API remains compatible. See MIGRATION.md for details.
- Core API: packages/core/README.md - Full API reference for TypeScript utilities
- React Hooks: packages/react/README.md - Hook documentation with examples
pnpm install
pnpm --filter dymo-print-suite-example dev# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Run tests in watch mode
pnpm test:watch- DYMO Label Web Service must be installed and running on the user's machine
- Supported browsers: Chrome, Firefox, Edge, Safari
MIT © apenab