424 downloads in less than a week! Blown away by the early response to @shivn7h/idiva. Here is why I built it:
Most Indian document validation libraries rely on guesswork. If you’ve built fintech apps, onboarding flows, or checkout systems handling Indian user data, you’ve probably seen custom regex snippets scattered across codebases for checking PAN, GSTIN, Aadhaar, or IFSC numbers.
The problem? Format validation isn't enough.
That’s why I created @shivn7h/idiva — a lightweight, zero-dependency npm package designed to validate and parse Indian identity and business identifiers using official checksum algorithms where they exist:
- Aadhaar verified against the Verhoeff checksum algorithm.
- GSTIN verified against the official Mod-36 checksum
- PAN, IFSC, UPI VPAs, & Vehicle Numbers validated for structure and parsed for metadata (e.g., state, holder type, branch code)
- Resilient input handling: Normalizes lowercase, extra spaces, and hyphens without throwing errors.
It doesnt replace live government API verification (like UIDAI or GSTN), but it catches malformed or mistyped data immediately at the client or API boundary before hitting downstream services.
Thank you to everyone who has tried it out so far!Check it out on npm: https://www.npmjs.com/package/@shivn7h/idiva

Top comments (0)