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

qrlayout-core

v1.1.5

Published

Headless rendering engine for QR code layouts, supporting ZPL, PDF, and Canvas.

Readme

qrlayout-core

A high-performance, framework-agnostic QR code layout engine designed for professional sticker and label generation. Create pixel-perfect layouts with text, QR codes, and dynamic data, with native support for PNG, PDF, and ZPL (Zebra Programming Language).

[!TIP] This package contains the headless rendering logic. For an interactive visual designer, use qrlayout-ui. It works seamlessly across React, Vue, Angular, Svelte, and Vanilla JS.

🚀 Live Demos & Examples

| Framework | Live Demo | Source Code | | :--- | :--- | :--- | | React | Live Demo | Source | | Svelte 5 | Live Demo | Source | | Vue 3 | Live Demo | Source |

✨ Core Features

  • Industrial Precision: Define layouts in mm, cm, in, or px.
  • ZPL Support: Direct export to Zebra Programming Language for thermal printers.
  • Batched Processing: Generate thousands of unique labels from a single template using dynamic data binding.
  • Hardware Agnostic: Renders to Canvas (Browser), Buffer (Node.js), or professional document formats.

📦 Installation

npm install qrlayout-core

⌨️ Quick Start

1. Define a Template

A layout is a robust JSON schema defining dimensions and elements.

import { type StickerLayout } from "qrlayout-core";

const template: StickerLayout = {
  id: "asset-tag",
  name: "Asset Label",
  width: 100, 
  height: 60,
  unit: "mm",
  elements: [
    { 
        id: "header", 
        type: "text", 
        x: 0, y: 5, w: 100, h: 10, 
        content: "PROPERTY OF CORP",
        style: { fontSize: 14, fontWeight: "bold", textAlign: "center" }
    },
    { 
        id: "id-qr", 
        type: "qr", 
        x: 35, y: 20, w: 30, h: 30, 
        content: "{{assetId}}" 
    }
  ]
};

2. Generate Output

Use the StickerPrinter to render the template with real data.

import { StickerPrinter } from "qrlayout-core";

const printer = new StickerPrinter();
const data = { assetId: "https://audit.co/ID-9921" };

// Render to Canvas for UI preview
await printer.renderToCanvas(template, data, myCanvasElement);

// Export to ZPL for thermal printing
const [zpl] = printer.exportToZPL(template, [data]);

📄 PDF Support (Optional)

PDF export is provided as an optional module to keep the core bundle lightweight.

npm install jspdf
import { exportToPDF } from "qrlayout-core/pdf";

const pdf = await exportToPDF(template, [data1, data2]);
pdf.save("labels.pdf");

📖 API Specification

StickerLayout Attributes

| Attribute | Type | Description | |---|---|---| | id | string | Unique identifier for the layout. | | name | string | Human-readable label name. | | width, height | number | Physical dimensions. | | unit | mm \| cm \| in \| px | Unit of measure. | | elements | StickerElement[] | Array of visual components. | | backgroundColor | string | (Optional) Background fill color hex. | | backgroundImage | string | (Optional) Background image URL. |

StickerElement Attributes

| Attribute | Type | Description | |---|---|---| | id | string | Unique identifier for the element. | | type | text \| qr | Component type. | | content | string | Text content or template (e.g. {{name}}). | | x, y, w, h | number | Position and size (top-left origin). | | qrSeparator | string | Separator for joining consecutive {{variables}}. | | style.fontFamily | string | Font family (e.g. 'Inter', 'sans-serif'). | | style.fontSize | number | Font size in pixels. | | style.fontWeight | string \| number | Font weight (e.g. 'bold', 700). | | style.textAlign | left \| center \| right | Horizontal text alignment. | | style.verticalAlign | top \| middle \| bottom | Vertical text alignment. | | style.color | string | Text color hex. | | style.backgroundColor | string | Element background color hex. |

📄 License

MIT