PakDataKit - v2.2.0
    Preparing search index...

    Changelog

    • getBankInfo(ibanOrCode) and getBanks(): bank name, type (commercial, Islamic, microfinance, digital, EMI, foreign, specialized, central), whether it still exists, and its current code.
    • API reference and llms.txt / llms-full.txt at https://chmuzamil.github.io/pakdatakit/.
    • New packages from this repository: pakdatakit for Python (PyPI) and pakdatakit-react (React inputs and a Raast QR component).
    • pakdatakit/input: as-you-type formatters (formatCNICInput, formatPhoneInput, formatIBANInput) and checkers (checkCNICInput, checkPhoneInput, checkIBANInput) that return empty, incomplete, valid or invalid.
    • createRaastP2PQr accepts expiresIn (30m, 12h, 7d or milliseconds) instead of expiresAt.
    • validateRaastQr(): checks a scanned QR for a bad checksum, missing or invalid IBAN, expiry and other problems before payment.
    • dataVersion export and DATA.md documenting each dataset's sources.
    • Banks: NAYA (NayaPay), BKCH (Bank of China), SMES (SME Bank), WMBL (Mobilink Bank's older code), and the digital banks RQMI (Raqami) and MSHQ (Mashreq Bank Pakistan).
    • Districts: Allai, Central Dir, Paharpur and Upper Swat (Khyber Pakhtunkhwa); Quetta East, Quetta West, North and South Dera Bugti, Barshore, Tump and Wadh (Balochistan, July 2026). 177 districts in total.
    • createRaastP2PQr / createMerchantQr reject amounts that would be written in exponent form (e.g. 1e21).
    • parseRaastQr reads only plain numeric amounts and rejects impossible expiry dates; createMerchantQr writes account sub-fields in ID order.
    • numberToWords / amountInWords reject unknown languages.
    • getDistrictProvince no longer returns built-in object properties.
    • Khushhali Microfinance Bank's IBAN code is KHBL, not KMBL.
    • Removed PAKB (Pak Oman), which no real IBAN supports.
    • getDistrictProvince still resolves districts that were split or renamed (Quetta, Dera Bugti, Upper Dera Bugti, South Waziristan).
    • createRaastP2PQr() with an amount made QR codes that banking apps reject. Amount QRs now include an expiry (tag 07, DDMMYYYYhhmm) and write whole amounts without decimals (1500, not 1500.00), matching dynamic QR codes from JazzCash and Mashreq. Pass the new expiresAt option; it is required whenever amount is set.
    • parseRaastQr() returns the expiry of person-to-person QR codes as expiresAt (YYYY-MM-DDTHH:mm).
    • createRaastP2PQr() now writes scheme identifier 00, matching QR codes generated by banking apps (Faysal Bank, easypaisa). The 30 listed in SBP's standard was rejected by the Easypaisa and JazzCash apps. Pass scheme: '30' to get the old behaviour.
    • SadaPay (SADA) in the IBAN bank list.
    • getCNICInfo(): province of registration and gender from a CNIC.
    • amountInWords() and numberToWords(): lakh/crore/arab/kharab in English and Urdu, with paisa and cheque style ("Rupees ... Only").
    • pakdatakit/zod, pakdatakit/valibot and pakdatakit/yup: form schemas for CNIC, phone, IBAN, NTN, STRN and landline. The libraries are optional peer dependencies.
    • analyzeNTN(), validateNTN() and validateSTRN() (format checks).
    • analyzeNumber(), getNumberType(), validateLandline() and getAreaCode(): landline, UAN, toll-free, premium and personal numbers, with area codes and cities.
    • createRaastP2PQr(), createMerchantQr() and parseRaastQr(): SBP Pakistan QR standard, with CRC checks.
    • getPakistanHolidays(), getHolidaysOn() and isPakistanHoliday(): federal public holidays with observed moon-sighting dates for 2020-2026 and flagged estimates for later years.
    • New subpaths: holidays, numbers, raast, tax, words.

    A bug-fix release. Several fixes change return values, so this is a major version.

    • Node.js 20+ is required (Node 18 is end-of-life).
    • formatPhone() and createWhatsAppLink() return null instead of "" for invalid numbers.
    • getHijriMonthName() returns null instead of "" for invalid months.
    • toHijri(), formatHijri() and isRamadan() throw a RangeError for invalid dates instead of returning NaN fields. fromHijri() throws for out-of-range Hijri components.
    • formatPKR() and formatLakh() throw a RangeError for NaN and Infinity, and keep the sign of negative amounts (they previously returned "Rs. 0" for all of these).
    • validatePhone() rejects numbers on 03XX prefixes that are not allocated to a mobile operator (e.g. 036x, 038x, 039x).
    • validateCNIC() rejects a leading 0 or 9, misplaced separators and mixed separators.
    • NetworkName adds 'SCO'.
    • ParsedAddress adds a warnings: string[] field.
    • formatAddress() no longer adds a GPO postal code that was not supplied.
    • normalizeRomanUrdu() keeps capitalisation (Assalam o Alaikum → Assalamualaikum) and no longer rewrites mein/men.
    • Dataset changes: South Waziristan is now Lower South Waziristan and Upper South Waziristan; neighbourhoods such as Gulberg and Saddar are no longer returned as cities; bank codes SILK, BIPL and BARC are removed.
    • Hijri dates were one day behind the tabular calendar for every date, and fromHijri(toHijri(d)) returned the previous day. Conversions now match islamic-civil exactly and round-trip. Added an offset option for moon-sighting adjustment.
    • Cities: the list was cut at 150 entries, so getProvince() returned null for Bahawalpur, Sargodha, Larkana, Mardan, Abbottabad and 72 other cities with postal codes. All 226 cities are now included.
    • Districts: 7 Gilgit-Baltistan districts were listed twice. Added Taunsa, Hub and Usta Muhammad, and split South Waziristan (168 districts).
    • Banks: SAUD is Silkbank's IBAN code (merged into UBL), not Saudi Pak; Summit Bank (now Bank Makramah) uses SUMB; renamed microfinance banks (easypaisa, HBL Microfinance, ABHI) now show current names. Removed an alias table that never took effect.
    • Phone: added 0329 (Jazz) and 0355 (SCO); accepts +92 (0) 3…, +9203…, dotted numbers and Urdu digits.
    • CNIC: accepts en-dashes, dots and Urdu digits.
    • formatLakh rounds before choosing the unit: 9,999,999 is "1 Crore", not "100 Lakh".
    • parseAddress ignores house, plot, street and PO box numbers when finding the postal code, works without commas, and reports city/province conflicts.
    • normalizeRomanUrdu: removed 6 rules that did nothing and the rules that changed mein ("in") to main ("I"); acronyms such as AP are left alone.
    • CLI exits with 1 for invalid/not found and 2 for usage errors, rejects non-numeric amounts and invalid dates, and supports --version.
    • CommonJS build alongside ESM.
    • Subpath imports (pakdatakit/cnic, pakdatakit/phone, …). Importing a single function no longer pulls in every dataset: validateCNIC alone bundles to about 0.4 KB instead of 25 KB.
    • Dataset integrity tests and CI on Node 20, 22 and 24 with a format check.
    • Interactive playground.