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

@e-rechnung-inbox/xrechnung-core

v0.1.0

Published

Stateless XRechnung/ZUGFeRD parsing, validation, and DATEV export helpers.

Readme

@e-rechnung-inbox/xrechnung-core

Stateless TypeScript helpers for XRechnung, ZUGFeRD / Factur-X, and the EN 16931 European e-invoice standard. Parsing, structural validation, and DATEV SKR03/SKR04 export helpers — no I/O, no persistence, no auth.

Powers e-rechnung-inbox.de and the companion MCP server.

Install

npm install @e-rechnung-inbox/xrechnung-core

Use

import {
  parseInvoiceXml,
  validateInvoiceData,
  extractXmlFromPdfBase64,
  generateDatevCsv,
} from "@e-rechnung-inbox/xrechnung-core";

const xml = "<Invoice>...</Invoice>";
const { parsed, lineItems } = parseInvoiceXml(xml);
const { issues, validationStatus } = validateInvoiceData(
  parsed,
  lineItems,
  "xrechnung",
);

console.log(validationStatus); // "valid" | "warning" | "invalid"
console.log(issues.length);    // number of structural issues found

What it does

  • parseInvoiceXml(xml) — walks UBL and CII flavored XRechnung trees defensively. Returns normalized ParsedInvoiceData + InvoiceLineItem[].
  • validateInvoiceData(parsed, lineItems, format) — structural checks (totals reconciliation, required-field coverage, tax breakdown sanity). Produces human-readable codes you can map to your own i18n strings.
  • extractXmlFromPdf(buffer) / extractXmlFromPdfBase64(base64) — pulls the Factur-X XML out of a ZUGFeRD PDF. Simple substring scanner — good enough for ~95% of real-world PDFs; a proper PDF walker is on the roadmap.
  • generateDatevCsv(invoices, frame, creditorStart) — emits the exact 20-column DATEV "Standard-Buchungsstapel" CSV the German tax-advisor tooling expects, CP1252-ready.
  • buSchluesselFromTaxBreakdown / kreditorAccountFor — the subtle SKR03/SKR04 account-mapping logic that keeps imports clean.

What it deliberately doesn't do

  • No KoSIT reference-implementation validation — that's a Java daemon; this package stays zero-runtime-dependency. Pair it with the @e-rechnung-inbox/xrechnung-mcp server or your own KoSIT deployment for reference parity.
  • No persistence, no auth, no i18n strings. Error codes are stable identifiers like missing_invoice_number; map them to user-facing text in your own layer.
  • No network calls. Pure data transformations.

Types

All shapes are exported. The canonical ones are Invoice, ParsedInvoiceData, InvoiceLineItem, InvoiceTaxBreakdownItem, and ValidationIssue. See src/types.ts.

Versioning

This package is still pre-1.0. Breaking changes in the parser shape or validation codes will bump the minor version until we cross 1.0.

License

MIT.