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
| Library | Version | Language | How it checks the rules |
|---|---|---|---|
| einvoice-ts | 0.5.0 | TypeScript | rules generated from the pinned CEN and Peppol Schematron |
@attestwire/en16931 | 0.14.1 | TypeScript | rules written by hand (294 rules, according to its README) |
einvoicing | 0.0.3 | TypeScript | a UBL reader; Document.validate() runs its rulesets |
| SaxonJS with the official Schematron | 2.7.0 | JavaScript | the official Schematron, compiled to XSLT and run by SaxonJS |
intragile/php-einvoicing | 1.3.0 | PHP | the official Schematron, interpreted in PHP |
josemmo/einvoicing | 0.3.1 | PHP | a UBL reader; rules written by hand (27 EN 16931 rules and 4 Peppol rules) |
| Saxon-HE with the official Schematron (Java) | 12.10 | Java | the 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
| Library | Valid accepted | Invalid rejected | Errors | Rule recall | Precision | Rules always / never found |
|---|---|---|---|---|---|---|
| einvoice-ts | 61/61 | 1,774/1,786 | 0 | 99.2% | 100.0% | 279 / 64 of 357 |
@attestwire/en16931 | 60/61 | 1,768/1,786 | 0 | 57.7% | 62.1% | 125 / 177 of 357 |
einvoicing | 42/61 | 427/1,786 | 446 | 0.0% | n/a | 0 / 357 of 357 |
| SaxonJS | 61/61 | 1,785/1,786 | 0 | 100.0% | 100.0% | 357 / 0 of 357 |
intragile/php-einvoicing | 61/61 | 1,785/1,786 | 0 | 98.9% | 99.8% | 337 / 20 of 357 |
josemmo/einvoicing | 61/61 | 1,683/1,786 | 1,503 | 3.4% | 93.5% | 0 / 347 of 357 |
Mutations
| Library | Valid accepted | Invalid rejected | Errors | Rule recall | Precision | Rules always / never found |
|---|---|---|---|---|---|---|
| einvoice-ts | 456/456 | 1,543/1,544 | 0 | 100.0% | 100.0% | 158 / 0 of 158 |
@attestwire/en16931 | 455/456 | 1,133/1,544 | 0 | 49.2% | 85.3% | 85 / 31 of 158 |
einvoicing | 369/456 | 435/1,544 | 522 | 0.0% | n/a | 0 / 158 of 158 |
| SaxonJS | 456/456 | 1,543/1,544 | 116 | 100.0% | 100.0% | 158 / 0 of 158 |
intragile/php-einvoicing | 456/456 | 1,543/1,544 | 0 | 100.0% | 100.0% | 158 / 0 of 158 |
josemmo/einvoicing | 456/456 | 172/1,544 | 33 | 4.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.
| Family | Reported | einvoice-ts | @attestwire/en16931 | einvoicing | SaxonJS | intragile/php-einvoicing | josemmo/einvoicing |
|---|---|---|---|---|---|---|---|
| BR (core) | 21,548 | 99.9% | 70.7% | 0.0% | 100.0% | 100.0% | 5.4% |
| BR-CO (calculations) | 3,832 | 99.9% | 35.6% | 0.0% | 100.0% | 100.0% | 0.0% |
| BR-CL (code lists) | 615 | 99.5% | 42.9% | 0.0% | 100.0% | 100.0% | 0.0% |
| BR-S, BR-Z, BR-E… (VAT) | 2,497 | 100.0% | 43.3% | 0.0% | 100.0% | 85.7% | 0.0% |
| UBL-CR, UBL-SR, UBL-DT | 440 | 99.3% | 0.0% | 0.0% | 100.0% | 100.0% | 0.0% |
| PEPPOL-EN16931 | 4,667 | 100.0% | 30.5% | 0.0% | 100.0% | 100.0% | 0.1% |
| National (DE, DK, GR, IT, …) | 415 | 43.9% | 0.0% | 0.0% | 100.0% | 100.0% | 0.0% |
Performance
Medians and means are per document.
| Library | Runtime | Median | Mean | p95 | Documents/s | Load | First | Peak memory |
|---|---|---|---|---|---|---|---|---|
einvoicing | Node 24 | 0.20 ms | 0.24 ms | 0.47 ms | 4,232 | 38 ms | 3 ms | 173 MiB |
@attestwire/en16931 | Node 24 | 0.28 ms | 0.33 ms | 0.65 ms | 3,012 | 33 ms | 10 ms | 172 MiB |
| einvoice-ts | Node 24 | 0.42 ms | 0.47 ms | 0.95 ms | 2,149 | 46 ms | 10 ms | 132 MiB |
josemmo/einvoicing | PHP 8.4 | 0.57 ms | 0.65 ms | 1.17 ms | 1,541 | 4 ms | 8 ms | 34 MiB |
| Saxon-HE, Schematron only | Java 21 | 1.81 ms | 2.05 ms | 4.11 ms | 488 | 869 ms | 102 ms | 572 MiB |
| Saxon-HE, XSD + Schematron | Java 21 | 1.81 ms | 2.08 ms | 3.81 ms | 480 | 1,031 ms | 108 ms | 631 MiB |
intragile/php-einvoicing | PHP 8.4 | 14.56 ms | 16.52 ms | 28.75 ms | 61 | 78 ms | 49 ms | 58 MiB |
| SaxonJS | Node 24 | 42.60 ms | 45.36 ms | 71.22 ms | 22 | 155 ms | 187 ms | 651 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/en16931does 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/en16931rejects 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.
einvoicingalso 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. einvoicinghas 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-einvoicingships 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.