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

@verifaktura/build

v0.1.8

Published

Gradi validne EN 16931 e-fakture (UBL 2.1) iz tipiziranog modela. Izlaz je garantovano provučen kroz verifaktura validator.

Readme

@verifaktura/build

Builds EN 16931 e-invoices (UBL 2.1) from a typed model. The output is run through the verifaktura validator in CI — that is the difference between an XML generator and a generator of valid XML.

npm install @verifaktura/build

Two levels

simpleInvoice — the ordinary case: one VAT rate, no document-level allowances.

import { buildUbl, simpleInvoice } from "@verifaktura/build";

const xml = buildUbl(simpleInvoice({
  id: "2026-001",
  issueDate: "2026-07-29",
  dueDate: "2026-08-28",
  currency: "EUR",
  vatRate: "25",
  iban: "HR1210010051863000160",
  seller: {
    name: "My Company Ltd",
    vatId: "HR12345678903",        // country prefix is required (BR-CO-09)
    address: { street: "Ilica 1", city: "Zagreb", postalCode: "10000", country: "HR" },
  },
  buyer: {
    name: "Customer Ltd",
    address: { street: "Riva 2", city: "Split", postalCode: "21000", country: "HR" },
  },
  lines: [{ name: "Software development", quantity: 10, unitPrice: "80.00" }],
}));

The full Invoice model — multiple VAT rates, document- and line-level allowances and charges, credit notes, exemptions with a reason. simpleInvoice is a thin layer over it, not a separate path: start simple and grow into it without rewriting.

const xml = buildUbl({
  id: "2026-003", issueDate: "2026-07-29", currency: "EUR",
  seller, buyer,
  lines: [
    { name: "Service A", quantity: "1", unitPrice: "100.00", vatCategory: "S", vatRate: "25" },
    { name: "Service B", quantity: "2", unitPrice: "50.00",  vatCategory: "S", vatRate: "13" },
  ],
  allowances: [{ amount: "10.00", reason: "Discount", vatCategory: "S", vatRate: "25" }],
  charges:    [{ amount: "5.00",  reason: "Shipping", vatCategory: "S", vatRate: "25" }],
});

What is computed for you

Omit vatBreakdown and totals and they are derived from the lines:

  • VAT breakdown grouped by category and rate (BG-23)
  • taxable base per group = Σ lines + Σ charges − Σ allowances (BR-S-08 and friends)
  • tax amount = base × rate / 100, half-up to 2 decimals (BR-CO-17)
  • VAT of 0 for the AE, K, G and O categories (BR-AE-09 and friends)
  • all document totals (BR-CO-10 through BR-CO-16)

You can also supply them explicitly — useful when mirroring an existing document and you want to keep the original even where it disagrees with the arithmetic.

Money

Everything is held as bigint in minor units; number is never used. Floating point would mean 0.1 + 0.2 !== 0.3 failing a document on BR-CO-15 or BR-CO-17 — a bug that shows up at a customer, on the thirtieth invoice, not in your tests.

Amounts are strings ("1234.56"); a comma is accepted too ("1234,56").

The model follows BT/BG

Every field is documented with its EN 16931 business term. When the validator reports BT-31, you know it means seller.vatId — no digging through the specification.

Croatian invoices

isValidOib checks the OIB checksum (ISO 7064 MOD 11,10) before you build. For the Croatian profile fields — issue time, operator, KPD classification — see @verifaktura/cius-hr.

Licence

Apache-2.0