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

@zpl-toolchain/core

v0.1.12

Published

ZPL II toolchain — parse, validate, format, and print Zebra Programming Language files (see @zpl-toolchain/print for printing)

Readme

@zpl-toolchain/core

TypeScript wrapper for the ZPL toolchain WASM bindings. Provides full TypeScript types and an ergonomic API for parsing, validating, formatting, and explaining ZPL code.

Part of the zpl-toolchain project.

Installation

npm install @zpl-toolchain/core

Usage

import { init, parse, format, validate, explain } from "@zpl-toolchain/core";

// Initialize WASM module (required once before calling any function)
await init();

// Parse ZPL
const result = parse("^XA^FDHello^FS^XZ");
console.log(result.ast.labels.length); // 1

// Format ZPL
const formatted = format("^XA^FD Hello ^FS^XZ", "label");

// Validate ZPL
const validation = validate("^XA^FDHello^FS^XZ");
console.log(validation.ok); // true

// Explain a diagnostic code
const explanation = explain("ZPL1201");

API

| Function | Signature | Description | |---|---|---| | init() | () → Promise<void> | Initialize WASM module (call once) | | parse(input) | (string) → ParseResult | Parse ZPL, return AST + diagnostics | | parseWithTables(input, tablesJson) | (string, string) → ParseResult | Parse with explicit parser tables | | validate(input, profileJson?) | (string, string?) → ValidationResult | Parse + validate | | validateWithTables(input, tablesJson, profileJson?) | (string, string, string?) → ValidationResult | Parse + validate with explicit parser tables | | format(input, indent?) | (string, IndentStyle?) → string | Format ZPL | | explain(id) | (string) → string \| null | Explain a diagnostic code |

Errors thrown by the WASM layer are wrapped with operation context (for example, @zpl-toolchain/core parse failed: ...) to make failures easier to diagnose in logs and callers.

Types

All types are exported and match the Rust AST serialization format:

  • Node — discriminated union on kind: CommandNode | FieldDataNode | RawDataNode | TriviaNode
  • Severity"error" | "warn" | "info" (lowercase, matching Rust serde)
  • Presence"unset" | "empty" | "value" (lowercase)
  • IndentStyle"none" | "label" | "field"
  • ValidationResult.resolved_labels — optional renderer-ready per-label resolved state snapshots

See src/index.ts for the full type definitions.

Build from source

# Install dependencies
npm install

# Build WASM artifacts (requires wasm-pack)
npm run build:wasm

# Build TypeScript package
npm run build