DEV Community

Cover image for I built 4 tiny npm packages for Indian developers
MANOJ CHOUDHARY
MANOJ CHOUDHARY

Posted on Edited on

I built 4 tiny npm packages for Indian developers

Every Indian developer rewrites the same utilities in every project: format rupees the Indian way (₹12,34,567, not ₹1,234,567), validate a PAN or GSTIN, build a UPI payment link, check if today is a gazetted holiday. I got tired of copying these snippets around, so I turned them into four small, zero-dependency npm packages. They're all MIT licensed and live today.

  1. india-format — Indian number and rupee formatting Indian digit grouping (lakh/crore), ₹ formatting, compact forms, and amount-in-words in both English and Hindi — the thing every invoice needs. import { formatINR, amountToWords, compactIndian } from 'india-format';

formatINR(1234567); // ₹12,34,567.00
amountToWords(123456); // One Lakh Twenty Three Thousand Four Hundred Fifty Six
amountToWords(123456, 'hi'); // एक लाख तेईस हज़ार चार सौ छप्पन
compactIndian(34000000); // 3.4 Crore

  1. india-validate — PAN, GSTIN, IFSC, Aadhaar and more Most validators on npm only check the shape of an ID with a regex. This one checks the actual checksums: GSTIN uses the real mod-36 check character (and validates the embedded PAN and state code), and Aadhaar uses the Verhoeff algorithm, so transposed digits get caught. import { isValidGSTIN, isValidPAN, isValidAadhaar } from 'india-validate';

isValidGSTIN('27AAPFU0939F1ZV'); // true
isValidGSTIN('27AAPFU0939F1Z5'); // false — checksum doesn't match
isValidPAN('ABCPE1234F'); // true
isValidAadhaar('234567890124'); // true (format + checksum only)
It also covers IFSC, PIN codes, Indian mobile numbers (with normalisation), and UPI VPAs. Note: Aadhaar validation is format/checksum only — it cannot confirm an Aadhaar number actually exists, and the README says so clearly.

  1. upi-qr-kit — UPI payment links for QR codes Builds and parses NPCI-spec upi://pay URIs — the links behind every UPI QR code — with proper parameter order and validation, so a malformed VPA or amount fails loudly instead of producing a QR that silently doesn't work. import { buildUpiUri, parseUpiUri } from 'upi-qr-kit';

buildUpiUri({ vpa: 'yourname@okhdfcbank', name: 'Your Shop', amount: 499, note: 'Order 42' });
// upi://pay?pa=yourname%40okhdfcbank&pn=Your%20Shop&tn=Order%2042&am=499&cu=INR
Pair it with any QR renderer (the README shows the qrcode package) and you have a working payment QR in a few lines.

  1. india-holidays — gazetted holidays with Hindi names The Central Government gazetted holiday list for 2026 (17 holidays, sourced from DoPT) with Hindi names, plus helpers to ask the questions apps actually ask: import { isHoliday, nextHoliday } from 'india-holidays';

isHoliday('2026-11-08'); // true (Diwali)
nextHoliday('2026-12-05'); // { date: '2026-12-25', name: 'Christmas Day', ... }
State holidays vary and festival dates can shift with moon sighting — the README is explicit about both, and contributions for state lists are welcome.
Why four small packages?
Because that's how utilities actually get used: you install the one you need, not a framework. Each package is zero-dependency, ships TypeScript types, and has tests (34 across the toolkit). They live in one monorepo so they stay consistent: https://github.com/manojchoudhary-dev/Bharat-ToolKit
If you build for Indian users, try one and tell me what's missing. Issues and PRs are welcome — there are good-first-issues labelled if you're looking for a first open-source contribution.

Top comments (0)