Skip to content

Comparison with other libraries ​

How einvoice-ts compares with other libraries that validate Peppol BIS Billing 3.0 invoices, in TypeScript, JavaScript, PHP and Java: how much of the specification each one checks, and how fast.

This is a one-off measurement, taken on 2026-11-29 with the versions listed below. einvoice-ts was 0.5.0, the first release pinned to Peppol BIS Billing 3.0.22: it was measured on commit 8d950f5, which 0.5.0 publishes with only the version numbers changed. The measurement is not re-run for each release, and every library in it, this one included, may have changed since.

The libraries ​

LibraryVersionLanguageHow it checks the rules
einvoice-ts0.5.0TypeScriptrules generated from the pinned CEN and Peppol Schematron
@attestwire/en169310.14.1TypeScriptrules written by hand (294 rules, according to its README)
einvoicing0.0.3TypeScripta UBL reader; Document.validate() runs its rulesets
SaxonJS with the official Schematron2.7.0JavaScriptthe official Schematron, compiled to XSLT and run by SaxonJS
intragile/php-einvoicing1.3.0PHPthe official Schematron, interpreted in PHP
josemmo/einvoicing0.3.1PHPa UBL reader; rules written by hand (27 EN 16931 rules and 4 Peppol rules)
Saxon-HE with the official Schematron (Java)12.10Javathe official validation pipeline, as phive and the KoSIT validator run it; performance only

Left out: libraries that validate through a remote service (@pixeldrive/peppol-toolkit), that generate or read UBL without checking rules (peppol-bis-billing, @ekwo-ai/peppol-ubl, @financica/ubl, num-num/ubl-invoice), that only cover CII (horstoeko/zugferd), and peppol-validator, whose Schematron step is the SaxonJS row.

Method ​

The reference. Every document goes through the official validation pipeline: the UBL 2.1 XSD, then the CEN and Peppol Schematron of Peppol BIS Billing 3.0.22 (with the CEN rules it ships, 1.3.16), compiled to XSLT by SchXslt2 and run by Saxon-HE. This is the conformance pipeline described in Contributing. A document is valid when the XSD accepts it and no fatal assert fails.

The documents. 3,847 in all:

  • 1,847 from the specification itself: the Peppol examples and national examples, the CEN test files, and every test fragment of the Peppol and CEN test sets. The official pipeline accepts 61 of them.
  • 2,000 mutations of the Peppol examples: one or two small edits each (an amount off by a cent, a removed element, an invalid code, and so on). The official pipeline accepts 456 of them.

The calls. Each library validates each document once, in a process of its own, through its documented API: validateXml() for einvoice-ts, validate() for @attestwire/en16931, UblReader and then validate() for the two readers, and Validator::en16931() or Validator::peppol() for intragile/php-einvoicing. Where a library lets the caller choose the rules, it gets the ones the reference applies: EN 16931 alone for the CEN documents, Peppol for the rest. josemmo/einvoicing stops at the first failed rule, so each of its rules was run separately to collect every failure; the verdict is the same either way. A library that throws on a document rejects it, and the throw counts as an error.

The coverage figures.

  • Valid accepted: of the documents the official pipeline accepts, how many the library accepts. A miss is a false alarm on a valid invoice.
  • Invalid rejected: of the documents the official pipeline rejects, how many the library rejects. A miss is an invalid invoice let through.
  • Rule recall: of the (document, rule) pairs the Schematron reports as fatal, how many the library reports under the same rule id. Precision: of the official rule ids the library reports, how many the Schematron also reports on that document.
  • Rules always / never found: of the distinct rules the Schematron reports, how many the library reports on every document where the Schematron does, and how many it never reports.

The performance figures. Each library validates the 40 complete documents the official pipeline accepts (the examples and the CEN test files): 5 rounds untimed, then 20 rounds with every call timed on its own, from the XML string to the verdict. Load is the time to load the library and its rules; first is the first validation after that. einvoice-ts was installed from its packed tarballs, as from npm. The machine was an Apple M4 Pro with 24 GB of memory, with Node 24.15, PHP 8.4.28 with opcache (in Docker, so in a Linux VM on the same machine) and Java 21.

Coverage ​

Documents from the specification ​

LibraryValid acceptedInvalid rejectedErrorsRule recallPrecisionRules always / never found
einvoice-ts61/611,774/1,786099.2%100.0%279 / 64 of 357
@attestwire/en1693160/611,768/1,786057.7%62.1%125 / 177 of 357
einvoicing42/61427/1,7864460.0%n/a0 / 357 of 357
SaxonJS61/611,785/1,7860100.0%100.0%357 / 0 of 357
intragile/php-einvoicing61/611,785/1,786098.9%99.8%337 / 20 of 357
josemmo/einvoicing61/611,683/1,7861,5033.4%93.5%0 / 347 of 357

Mutations ​

LibraryValid acceptedInvalid rejectedErrorsRule recallPrecisionRules always / never found
einvoice-ts456/4561,543/1,5440100.0%100.0%158 / 0 of 158
@attestwire/en16931455/4561,133/1,544049.2%85.3%85 / 31 of 158
einvoicing369/456435/1,5445220.0%n/a0 / 158 of 158
SaxonJS456/4561,543/1,544116100.0%100.0%158 / 0 of 158
intragile/php-einvoicing456/4561,543/1,5440100.0%100.0%158 / 0 of 158
josemmo/einvoicing456/456172/1,544334.2%89.1%6 / 140 of 158

Rule recall by rule family ​

Over all 3,847 documents. Reported is how many (document, rule) pairs of the family the Schematron reports.

FamilyReportedeinvoice-ts@attestwire/en16931einvoicingSaxonJSintragile/php-einvoicingjosemmo/einvoicing
BR (core)21,54899.9%70.7%0.0%100.0%100.0%5.4%
BR-CO (calculations)3,83299.9%35.6%0.0%100.0%100.0%0.0%
BR-CL (code lists)61599.5%42.9%0.0%100.0%100.0%0.0%
BR-S, BR-Z, BR-E… (VAT)2,497100.0%43.3%0.0%100.0%85.7%0.0%
UBL-CR, UBL-SR, UBL-DT44099.3%0.0%0.0%100.0%100.0%0.0%
PEPPOL-EN169314,667100.0%30.5%0.0%100.0%100.0%0.1%
National (DE, DK, GR, IT, …)41543.9%0.0%0.0%100.0%100.0%0.0%

Performance ​

Medians and means are per document.

LibraryRuntimeMedianMeanp95Documents/sLoadFirstPeak memory
einvoicingNode 240.20 ms0.24 ms0.47 ms4,23238 ms3 ms173 MiB
@attestwire/en16931Node 240.28 ms0.33 ms0.65 ms3,01233 ms10 ms172 MiB
einvoice-tsNode 240.42 ms0.47 ms0.95 ms2,14946 ms10 ms132 MiB
josemmo/einvoicingPHP 8.40.57 ms0.65 ms1.17 ms1,5414 ms8 ms34 MiB
Saxon-HE, Schematron onlyJava 211.81 ms2.05 ms4.11 ms488869 ms102 ms572 MiB
Saxon-HE, XSD + SchematronJava 211.81 ms2.08 ms3.81 ms4801,031 ms108 ms631 MiB
intragile/php-einvoicingPHP 8.414.56 ms16.52 ms28.75 ms6178 ms49 ms58 MiB
SaxonJSNode 2442.60 ms45.36 ms71.22 ms22155 ms187 ms651 MiB

einvoicing and josemmo/einvoicing run few or no rules, so their times are mostly reading the document. Peak memory is the peak resident set size of the whole process, documents included.

Reading the numbers ​

  • einvoice-ts was built against these documents. Its agreement with the official pipeline is tested on the same specification documents and with the same kinds of mutation (other mutations of the same kinds here), and the other libraries were not. The documents are the specification's own tests, so they are a fair test of conformance, but part of the lead is home advantage.
  • Most test fragments are incomplete documents. Each is written to trigger one rule, so it fails many others too, and the official pipeline rejects almost all of them. A library that rejects everything would score well on invalid rejected. Read that column next to valid accepted and the rule recall.
  • Rule ids measure agreement with the Schematron, not whether a finding is right. When a whole group is missing, the Schematron reports the rule whose context exists, such as BR-08 for a seller without a postal address. A library that checks its own model may report a neighbouring rule instead (BR-09, the country code), or rules the Schematron cannot evaluate without their context (BR-12 to BR-15 on a fragment without totals). Either counts as a miss and a false positive. @attestwire/en16931 does this on many test fragments, which accounts for most of its lower precision on the specification documents.
  • Rules change between releases. The one valid specification document @attestwire/en16931 rejects is a Peppol 3.0.22 test: an invoice of type 384 between two Slovak parties, which PEPPOL-EN16931-P0112 allows since that release.
  • Errors count as rejections. The two readers throw on many test fragments, which raises their invalid rejected. einvoicing also throws on 19 of the 61 valid documents, for example on a document without payment means or an allowance whose tax category it cannot find. The SaxonJS errors are Schematron dynamic errors, such as an empty date, which Saxon-HE raises on the same documents; the official pipeline rejects those documents too.
  • einvoicing has no Peppol rules. Its Peppol ruleset is empty. Its Danish ruleset has one rule, but it shares the Peppol customization id and is never selected.
  • Rule ids differ between CEN releases. For Peppol, intragile/php-einvoicing ships the same release as the reference, 3.0.22 with CEN 1.3.16. For plain EN 16931 it uses CEN's own 1.3.17, which names the Canary Islands and Ceuta and Melilla VAT rules BR-IG and BR-IP, where the CEN copy in Peppol 3.0.22 names them BR-AF and BR-AG. All 356 of its misses are those rules on the CEN documents, reported under the other ids: a naming difference, not missed checks. They are also why its VAT family recall is 85.7%.
  • National rules. The Peppol Schematron applies national rules (DE, DK, GR, IT, NL, NO, SE) by supplier country. einvoice-ts implements the Danish ones only, so it misses the others: the 12 invalid specification documents it accepts all fail a German or Dutch rule.
  • The XSD. Only einvoice-ts (through its structural checks) and the Saxon-HE row with the XSD check the UBL schema. A document that only the XSD rejects counts against the others; there are few.
  • Performance is one machine and one run. The figures come from a few dozen realistic documents, not a controlled benchmark: compare orders of magnitude, not the last digit. Load and first-call times include each runtime's start-up work for the library, such as the JVM compiling the XSLT or SaxonJS reading the compiled stylesheet, but not the process start.

MIT licensed. Specification material belongs to OpenPeppol, CEN and OASIS (see NOTICE). Peppol is a trademark of OpenPeppol AISBL; this project is not affiliated with it.