npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dymo-print-suite/core

v1.0.0

Published

Core TypeScript library for DYMO Label Web Service

Readme

@dymo-print-suite/core

Core TypeScript library for interacting with DYMO Label Web Service. Use this package when you want the DYMO helpers without React.

Using React? Check out @dymo-print-suite/react for ready-to-use hooks.

Installation

npm install @dymo-print-suite/core
# or
pnpm add @dymo-print-suite/core
# or
yarn add @dymo-print-suite/core

Usage

Note: Examples use async/await syntax. For CommonJS or environments without top-level await, wrap calls in an async function.

Print a Label

import { printLabel } from "@dymo-print-suite/core";

async function print() {
  const labelXml = `<?xml version="1.0" encoding="utf-8"?>
<DieCutLabel Version="8.0" Units="twips">
  <!-- Your label XML -->
</DieCutLabel>`;

  await printLabel("DYMO LabelWriter 450", labelXml);
}

print();

Build Custom Requests

import { dymoRequestBuilder } from "@dymo-print-suite/core";

async function fetchPrinters() {
  const response = await dymoRequestBuilder({
    method: "GET",
    wsAction: "getPrinters",
  });

  console.log(response.data);
}

fetchPrinters();

Parse Printer List from XML

import { getDymoPrintersFromXml } from "@dymo-print-suite/core";

const printers = getDymoPrintersFromXml(xmlResponse, "LabelWriterPrinter");

printers.forEach((printer) => {
  console.log(`${printer.name}: ${printer.isConnected ? "Online" : "Offline"}`);
});

Request Cancellation

import { dymoRequestBuilder, isRequestCancelled } from "@dymo-print-suite/core";

async function fetchWithCancellation() {
  const controller = new AbortController();

  // Cancel after 5 seconds
  setTimeout(() => controller.abort(), 5000);

  try {
    const response = await dymoRequestBuilder({
      method: "GET",
      wsAction: "status",
      signal: controller.signal,
    });
    console.log(response.data);
  } catch (error) {
    if (isRequestCancelled(error)) {
      console.log("Request was cancelled");
    }
  }
}

fetchWithCancellation();

API

printLabel(printerName, labelXml, labelSetXml?)

Print a label to a DYMO printer.

  • printerName - Name of the DYMO printer
  • labelXml - Label XML content
  • labelSetXml - Optional. LabelSet XML for printing multiple labels

dymoRequestBuilder(config)

Build and execute requests to the DYMO web service.

interface DymoRequestConfig {
  wsProtocol?: string;
  wsPath?: string;
  wsAction: WsAction;
  method: "GET" | "POST";
  signal?: AbortSignal;
  fetchOptions?: RequestInit;
}

dymoUrlBuilder(protocol, host, port, path, action)

Build a URL for the DYMO web service.

getDymoPrintersFromXml(xml, modelPrinter)

Parse XML response from GetPrinters endpoint into typed printer objects.

isRequestCancelled(error)

Check if an error is a cancellation error.

localStore(key, data, timeout?) / localRetrieve(key, defaultValue?)

Storage utilities with optional expiration.

Types

interface DymoPrinter {
  name: string;
  modelName: string;
  isLocal: boolean;
  isTwinTurbo: boolean;
  isConnected: boolean;
}

interface DymoResponse<T = any> {
  data: T;
  status: number;
  statusText: string;
  url: string;
}

type WsAction =
  | "status"
  | "getPrinters"
  | "openLabel"
  | "printLabel"
  | "printLabel2"
  | "renderLabel"
  | "loadImage"
  | "getJobStatus";

Requirements

Related

License

MIT