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

fiskalizimi-utils

v0.1.0

Published

Utilities for Albanian fiscalization (Law 87/2019): NIPT/NUIS validation, TVSH (VAT) math, and fiscal invoice totals with per-rate VAT breakdown. Zero dependencies.

Readme

fiskalizimi-utils

Zero-dependency TypeScript utilities for Albanian fiscalization (Law 87/2019 "On the invoice and the circulation monitoring system"): NIPT/NUIS validation, TVSH (VAT) math, and fiscal invoice totals with the per-rate VAT breakdown every fiscalized invoice must report.

Built and maintained by Square Software, a software company in Tirana that ships fiscalization integrations for POS, ERP and e-commerce systems. These are the same pure functions that power our free online tools:

Install

npm install fiskalizimi-utils
# or straight from GitHub:
npm install github:square-al/fiskalizimi-utils

Usage

Validate a NIPT / NUIS

import { validateNipt } from 'fiskalizimi-utils'

const res = validateNipt(' m5 1418-039h ') // separators + case are normalized
res.valid       // true
res.normalized  // 'M51418039H'
res.parts       // { prefix: 'M', digits: '51418039', checkLetter: 'H' }

validateNipt('M5141803OH')
// { valid: false, issues: ['digits-not-numeric'], likelyTypo: true }  ← O vs 0

Format-level validation only (letter A–M + 8 digits + control letter). A well-formed NIPT is not necessarily registered — check existence in the official registry (QKB), e.g. https://opencorporates.al/sq/nipt/m51418039h.

TVSH (VAT) math

import { addVat, extractVat, ALBANIA_VAT, KOSOVO_VAT } from 'fiskalizimi-utils'

addVat(1000, ALBANIA_VAT.standard)   // { net: 1000, vat: 200, gross: 1200, rate: 0.2 }
extractVat(1180, KOSOVO_VAT.standard) // net 1000, vat 180 — Kosovo 18%

Fiscal invoice totals

import { invoiceTotals } from 'fiskalizimi-utils'

const t = invoiceTotals([
  { description: 'Service A', quantity: 2, unitPrice: 500, vatRate: 0.2 },
  { description: 'Book', quantity: 1, unitPrice: 800, vatRate: 0.06, discountRate: 0.1 },
])
t.subtotal  // net total
t.totalVat  // VAT total
t.vatByRate // [{ rate: 0.2, base: 1000, vat: 200 }, { rate: 0.06, base: 720, vat: 43.2 }]

vatByRate is the per-rate base/VAT table a fiscalized invoice reports.

Shqip

Mjete TypeScript pa varësi për fiskalizimin shqiptar: verifikim i formatit të NIPT/NUIS, llogaritje TVSH-je (shto/hiq nga një vlerë) dhe totalet e faturës me TVSH-në e ndarë sipas normës — ashtu siç e raporton një faturë e fiskalizuar. I njëjti kod që fuqizon llogaritësit tanë falas. Për integrime fiskalizimi në sistemet tuaja, shihni square.al.

Notes

  • Rates and rules change; confirm current TVSH rates and fiscalization requirements with the tax authority before invoicing.
  • No network calls, no dependencies, side-effect free — safe for browser and Node.

License

MIT © Square Software SHPK