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

@milchrechnungat/core

v0.11.1

Published

Canonical EN 16931 invoice model with parsers and renderers for ebInterface 6.1, PEPPOL BIS 3.0, Factur-X 1.0, ZUGFeRD 2.3, and XRechnung 3.0 (CII + UBL)

Readme

@milchrechnungat/core

Parse and render European e-invoices against a shared canonical model. Supports ebInterface 6.1 (Austria) and PEPPOL BIS 3.0 (EU-wide). The canonical model implements the EN 16931 semantic standard.

Install

pnpm add @milchrechnungat/core
# or
npm install @milchrechnungat/core

Usage

import { parsePeppolBis30, renderEbInterface61 } from "@milchrechnungat/core";

// Parse a PEPPOL BIS 3.0 XML document
const result = parsePeppolBis30(xmlBytes);          // Uint8Array → ParseResult
if (!result.ok) throw new Error(result.errors[0].message);

// Render the canonical invoice as ebInterface 6.1
const rendered = renderEbInterface61(result.canonical); // canonical → RenderResult
if (!rendered.ok) throw new Error(rendered.errors[0].message);

console.log(new TextDecoder().decode(rendered.bytes));

All parsers and renderers are pure functions — no I/O, no network, no global state.

Supported formats

| Format | Direction | |--------|-----------| | PEPPOL BIS 3.0 | parse + render | | ebInterface 6.1 | parse + render |

Conversion matrix

CONVERSION_MATRIX describes every source→target format pair, its status, and which lossiness concerns apply.

import { CONVERSION_MATRIX, getAvailableTargets, getConversionEntry } from "@milchrechnungat/core";
import type { FormatId } from "@milchrechnungat/core";

// All entries (4 for 2 formats: 2×2)
console.log(CONVERSION_MATRIX);

// Only actionable targets for a given source (status "available" or "partial")
const targets = getAvailableTargets("ebinterface-6.1");
// → [{ source: "ebinterface-6.1", target: "peppol-bis-3.0", status: "partial", noteKeys: [...] }]

// Look up a specific pair
const entry = getConversionEntry("peppol-bis-3.0", "ebinterface-6.1");
// → { source: "peppol-bis-3.0", target: "ebinterface-6.1", status: "partial", noteKeys: ["conversion.payment-means-mapping"] }

noteKeys are namespaced i18n keys (e.g. "conversion.payment-means-mapping") that describe known lossiness for that direction. The core ships the keys; translation strings live in the consuming application.

| Source | Target | Status | noteKeys | |--------|--------|--------|----------| | ebinterface-6.1 | ebinterface-6.1 | unavailable | — | | ebinterface-6.1 | peppol-bis-3.0 | partial | charge-total-allocation, buyer-reference-required | | peppol-bis-3.0 | ebinterface-6.1 | partial | payment-means-mapping | | peppol-bis-3.0 | peppol-bis-3.0 | unavailable | — |

Helper functions:

| Function | Returns | |----------|---------| | getConversionEntry(source, target) | The single ConversionEntry for that pair, or undefined | | getAvailableTargets(source) | All entries where status is "available" or "partial" | | getAllTargets(source) | All entries for the source, including "unavailable" and "coming_soon" |

License

Apache 2.0 — Copyright 2026 Rudolf Bohrer

Repository

https://github.com/milchrechnung/milchrechnung-core