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 🙏

© 2025 – Pkg Stats / Ryan Hefner

zpl2svg

v1.0.1

Published

ZPL (Zebra) to SVG converter in vanilla JS.

Readme

Vanilla JS implementation of a stand-alone ZPL (Zebra Programming Language) to SVG converter.

It is a work in progress and is not yet complete.

You can try it out here: ZPL to SVG Converter

image

The goal is to be able to convert from ZPL to SVG and possibly vice verse. The conversion speed is decently fast with under 10ms from current testing. There are still a lot of bugs and missing features.

Dependencies:

  • bwip-js for barcode rendering
  • pako for Z64 graphic encoding
  • canvas for graphic fields (only for Node.JS)

Practical usage

Node.JS first install:

npm i zpl2svg

CJS Browser import via CDN:

<script src="https://cdn.jsdelivr.net/npm/zpl2svg/dist/zpl2svg.min.js"></script>

ESM Browser import via CDN:

<script type="module">
  import { zpl2svg } from 'https://cdn.jsdelivr.net/npm/zpl2svg/dist/zpl2svg.mjs';
</script>

Node.JS import:

// ESM
import { zpl2svg, zpl2png } from 'zpl2svg';
// CJS
const { zpl2svg, zpl2png } = require('zpl2svg');

Example:

const zpl_content = `
  ^XA
  ^CF0,32
  ^FO20,20^GB330,220,3^FS
  ^FO120,40^A0N,30,30^FDHello ZPL!^FS
  ^FO40,100^BY2^B3N,N,100,Y,N^FD1234567^FS
  ^XZ
`
const svg_content = zpl2svg(zpl_content, {
  scale: 1,
  width: 370,
  height: 260
})
Supported ZPL command list:
  • ^XA Start of label
  • ^PR Print rate (skipped)
  • ^FX Comment
  • ^FS End of field
  • ^CF Font selection
  • ^FO/^F0 Field origin
  • ^GB Graphic box
  • ^GD Graphic diagonal line
  • ^GC Graphic circle
  • ^GE Graphic ellipse
  • ^FR Field reverse point
  • ^FD Field data
  • ^BY Barcode field default parameters
  • ^B0/^BO Aztec code (partially implemented)
  • ^B1 Code 11
  • ^B2 Interleaved 2 of 5
  • ^B3 Code 39
  • ^B4 Code 49
  • ^B5 Planet code
  • ^B7 PDF417
  • ^B8 EAN8
  • ^B9 UPCE
  • ^BA Code 93
  • ^BB Coda block
  • ^BC Code 128
  • ^GF Graphic field
  • ^XZ End of label