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

@xdarkoy/schema

v0.1.1

Published

Shared report document schema (the modern RDLC) – TypeScript types + JSON Schema

Readme

@xdarkoy/schema

The shared report document schema for the Reporting designer — TypeScript types plus small runtime helpers. Consumed by both the React designer (@xdarkoy/designer) and the Python render backend, so a report is one portable JSON file (*.myreport.json).

npm i @xdarkoy/schema

Document shape

interface ReportDocument {
  schemaVersion: "1.0.0";
  meta: { title: string; author?: string; /* … */ };
  page: { size: "A4"|"A5"|"A3"|"Letter"|"Legal"|{width;height}; orientation; margin; unit };
  dataSources: DataSource[];
  parameters: Parameter[];
  bands: Band[];                 // pageHeader, reportHeader, groupHeader, body, groupFooter, reportFooter, pageFooter
  grouping?: { dataSource: ValueExpr; field: string };  // band-level grouping
}

Element types: text, image, rectangle, line, barcode, table, chart, crosstab, subreport, pagebreak.

Helpers

import {
  createEmptyReport,        // (title?) => ReportDocument with default bands
  paperSizeMm,              // (size, orientation) => { width, height } in mm
  mmToPx, pxToMm,           // unit conversion (dpi default 96)
  isBindingExpression,      // (value) => boolean
  validateReport,          // (doc) => { ok: true } | { ok: false; error }
  resolveParameters,        // (parameters) => { name: value } for {{params.x}}
  sanitizeElement,          // coerce one untrusted element -> valid (id/type/bounds) or null
  sanitizeElements,         // coerce a list, dropping unsalvageable entries
  sanitizeReport,           // sanitize every element in a document's bands
  SCHEMA_VERSION, DEFAULT_PAGE,
} from "@xdarkoy/schema";

const doc = createEmptyReport("Rechnung");

sanitize* are useful when ingesting untrusted/AI‑generated documents before handing them to the renderer or UI.

Bindings & expressions (used in element values)

  • Interpolation: "Hallo {{invoice.customer.name}}"
  • Expression: "= row.qty * row.price" (arithmetic, comparison, && || !, ternary, functions abs round floor ceil sqrt min max; ** is intentionally unsupported)
  • Formatting: "{0:C}", "{0:N2}", "{0:P}", "yyyy-MM-dd"
  • Special fields: {{Page}}, {{PageCount}}, {{PageNofM}}, {{PrintDate}}, {{PrintTime}}, {{ReportTitle}}, {{RowNumber}} (in table rows), {{group}}/{{groupItems}}/{{GroupCount}} (in group bands)

See docs/USAGE.md for the full guide.

Licensed under Apache‑2.0.