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

india-validators

v0.1.0

Published

Client-side validation library for common Indian document and identifier formats — Aadhaar, PAN, GSTIN, IFSC, PIN code, mobile, vehicle, passport and UPI.

Readme

india-validators

Live Demo

npm MIT License Open Source Zero Dependencies

Client-side validation library for common Indian document and identifier formats. Zero dependencies. Works in browser and Node.js.

DISCLAIMER: This library performs format and checksum validation only. It does NOT verify identity, authenticate with any government API, or store any data. Always comply with applicable Indian laws when handling sensitive identifiers.


Validators

| Validator | What it checks | |---|---| | aadhaar | 12-digit format + Verhoeff checksum | | pan | 10-char format + entity type | | gstin | 15-char format + state code + mod-36 checksum | | ifsc | 11-char bank code format | | pincode | 6-digit PIN + postal zone | | mobile | 10-digit Indian mobile + series check | | vehicle | India vehicle registration format | | passport | Indian passport number format | | upi | UPI virtual payment address format |


Install

npm install india-validators

Or via CDN:

<script src="https://cdn.jsdelivr.net/gh/Gorupa/india-validators/india-validators.js"></script>

Usage

Individual validators

Every validator returns { valid: boolean, message: string, meta?: object }.

const IV = require('india-validators');

// Aadhaar — Verhoeff checksum validation
IV.aadhaar('2345 6789 0123');
// → { valid: true, message: 'Valid Aadhaar format.' }

// PAN — format + entity type
IV.pan('ABCDE1234F');
// → { valid: true, message: 'Valid PAN format.', meta: { entity: 'Individual', entityCode: 'P' } }

// GSTIN — format + state + checksum
IV.gstin('27AAAPZ0327R1ZV');
// → { valid: true, message: 'Valid GSTIN.', meta: { state: 'Maharashtra', pan: 'AAAPZ0327R' } }

// IFSC — bank code format
IV.ifsc('SBIN0001234');
// → { valid: true, message: 'Valid IFSC format.', meta: { bankCode: 'SBIN', branchCode: '001234' } }

// PIN code — 6-digit format + zone
IV.pincode('400001');
// → { valid: true, message: 'Valid PIN code format.', meta: { zone: 'Maharashtra, Goa, MP, Chhattisgarh' } }

// Mobile — 10-digit Indian mobile
IV.mobile('+91 9876543210');
// → { valid: true, message: 'Valid Indian mobile number.' }

// Vehicle registration
IV.vehicle('MH12AB1234');
// → { valid: true, message: 'Valid vehicle registration format.', meta: { stateCode: 'MH', rto: 'MH12' } }

// Passport
IV.passport('A1234567');
// → { valid: true, message: 'Valid Indian passport format.' }

// UPI ID
IV.upi('gaurav@okaxis');
// → { valid: true, message: 'Valid UPI ID format.', meta: { username: 'gaurav', handle: 'okaxis', knownProvider: true } }

Batch validation

Validate multiple fields at once:

const results = IV.validate({
    pan:    'ABCDE1234F',
    mobile: '9876543210',
    gstin:  '27AAAPZ0327R1ZV',
    ifsc:   'SBIN0001234',
});

// results.pan.valid    → true
// results.mobile.valid → true
// results.gstin.meta.state → 'Maharashtra'

Browser usage

<script src="https://cdn.jsdelivr.net/gh/Gorupa/india-validators/india-validators.js"></script>
<script>
    const r = IndiaValidators.pan('ABCDE1234F');
    console.log(r.valid, r.message);
</script>

Return format

All validators return a consistent object:

{
    valid:   true | false,
    message: 'Human readable message',
    meta:    { /* optional extra info */ }
}

File Structure

india-validators/
├── india-validators.js    ← the library
├── demo/
│   └── index.html         ← live demo
├── package.json
├── README.md
└── LICENSE

Contributing

PRs welcome. Ideas for v0.2:

  • [ ] Voter ID format validation
  • [ ] DL (Driving Licence) format validation
  • [ ] CIN (Company Identification Number)
  • [ ] TAN (Tax Deduction Account Number)
  • [ ] Bank account number format checks
  • [ ] TypeScript definitions (.d.ts)

Legal note

This library only validates format and checksum — the same information printed on the document itself. It does not connect to UIDAI, NSDL, GSTN, or any government system. No data is sent anywhere. The developer is responsible for ensuring compliance with applicable laws when collecting and processing sensitive identifiers.


License

MIT © 2026 gorupa