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

@ekwo-ai/xaf

v0.25.0

Published

Reads an XML Audit File Financial (XAF, versions 3.2 and 4.0) — the accounts, the parties, the opening balance and every transaction of a year — into plain objects in TypeScript: amounts as decimal strings, the file's own totals checked, and what does not

Readme

@ekwo-ai/xaf

Reads an XML Audit File Financial — the XML Auditfile Financieel, XAF, the file an accounting package hands over when an auditor or a tax authority asks for the books of a year — into plain objects, in TypeScript, with no dependencies. Versions 3.2 and 4.0 are read, each recognised by the namespace of its schema.

import { readXaf } from '@ekwo-ai/xaf';

const books = readXaf(bytes); // a string, or the bytes of the file

books.version;     // '4.0'
books.currency;    // 'EUR', from header/curCode
books.entries;     // [{ journal: 'VK', number: '2025001', date: '2025-01-15', lines: […] }, …]
books.opening;     // the obLine of the opening balance
books.openingDate; // opBalDate (3.2), or the first day of the year (4.0)
books.violations;  // a transaction that does not balance, totals the lines disagree with

What is read

| Part of the books | Where it sits in the file | |---|---| | currency | header/curCode | | accounts | company/generalLedger/ledgerAccount: accID, accDesc, accTp (B, P, M, kept as written) | | parties | company/customersSuppliers/customerSupplier: custSupID, custSupName, eMail, taxRegIdent, commerceNr, the country of its first address | | opening balance | company/openingBalance/obLine: accID, amnt, amntTp; its date opBalDate in 3.2, header/startDate in 4.0, which has none | | entries | company/transactions/journal (jrnID, desc) /transaction (nr, desc, trDt) | | lines | trLine: accID, desc, amnt and amntTp (D or C), custSupID, docRef (the first one is the entry's reference), currency/curCode and curAmnt, and in 3.2 matchKeyID |

  • An amount is an xsd:decimal; its side is amntTp. A negative amount is the other side.
  • The file states its own totals — linesCount, totalDebit, totalCredit — for the opening balance and for the transactions, and each is held against what the lines add up to. A file that disagrees with itself, or a transaction that does not balance, comes back as written, with a violation.
  • The encoding is the one the XML declaration names — UTF-8 or ISO-8859-1 — and UTF-8 when it names none, as XML provides. A caller who names another is refused rather than obeyed.
  • The XML is read by a strict reader of its own: no DOCTYPE, no entity beyond the five XML predefines, bounds on size, depth and element count.

What is not read: the sub-ledgers of version 3.2 (subledgers, obSubledgers), which restate by party what the lines already say; the VAT codes and the tax amounts of a line; the periods; the history of changes.

What it returns

The shape declared in src/types.ts, which is, field for field, the shape every reader of an accounting export in this repository declares for itself, plus the version of the file and the openingDate of its opening balance. Amounts are decimal strings, never negative. What is not an audit file is thrown as a BooksFileError with a code.

It knows no chart of accounts: in Ekwo OS the correspondence is made by ekwo import xaf <file>.

Sources

The format was read on 24 September 2026 from the schemas the Dutch tax administration publishes on its developer portal — XmlAuditfileFinancieel3.2.xsd and XmlAuditfileFinancieel4.0.xsd, kept under test/xsd/ with where each came from — and from the pages of that portal: Auditfile Financieel (XAF) v 3.2.1, XMLAuditfile Financieel (XAF) v 4.0.3, Achtergrond informatie XAF4.0.

It was written against the audit file Exact Online exports, as its help centre describes it on the same day: Auditfiles in xml-formaat (XAF) exporteren — Import/Export > Export > Audit file; entries not yet processed are not in the file. ekwo import exact-online <file> is the same as ekwo import xaf.

The fixtures under test/fixtures/, one per version, are written by hand, hold no real data, and are validated against the schema of their version by test/schema.test.ts.

MIT.