{"id":19716565,"url":"https://github.com/mastermunj/format-utils","last_synced_at":"2025-04-29T20:30:45.345Z","repository":{"id":36986418,"uuid":"259281784","full_name":"mastermunj/format-utils","owner":"mastermunj","description":"Utilities for validating various formats of Indian system codes like Mobile, PAN, AADHAAR, GST, and more!","archived":false,"fork":false,"pushed_at":"2025-04-28T11:14:41.000Z","size":9815,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-28T12:28:09.769Z","etag":null,"topics":["aadhaar","aadhaar-number-validator","esic","gst","gstin","ifsc","imei","india","mobile","pan","pincode","tan","uan","validation","vehicle-registration"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mastermunj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-27T10:33:27.000Z","updated_at":"2025-04-28T11:14:38.000Z","dependencies_parsed_at":"2023-01-17T11:47:57.513Z","dependency_job_id":"ee726ccb-b3d1-4944-9c01-07b97455c819","html_url":"https://github.com/mastermunj/format-utils","commit_stats":{"total_commits":1121,"total_committers":3,"mean_commits":373.6666666666667,"dds":0.088314005352364,"last_synced_commit":"e61faa083637fcfdfe3d01470fc6e7b5a372145a"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mastermunj%2Fformat-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mastermunj%2Fformat-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mastermunj%2Fformat-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mastermunj%2Fformat-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mastermunj","download_url":"https://codeload.github.com/mastermunj/format-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251315100,"owners_count":21569734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aadhaar","aadhaar-number-validator","esic","gst","gstin","ifsc","imei","india","mobile","pan","pincode","tan","uan","validation","vehicle-registration"],"created_at":"2024-11-11T22:42:35.231Z","updated_at":"2025-04-29T20:30:44.979Z","avatar_url":"https://github.com/mastermunj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Format Validation Utilities\n\n## Introduction\n\nUtilities for validating various formats of Indian system codes like Mobile, PAN, AADHAAR, GST and more!\n\n## Installation\n\n```js\nnpm install format-utils --save\n```\n\n## Usage\n\n```js\nconst { Validator } = require('format-utils');\n```\nOR\n```js\nimport { Validator } from 'format-utils';\n```\n\n## Available Validators\n\n### Mobile\n\nA mobile is a 10 digit numerical code starting with either 6, 7, 8, 9.\n\n```js\nlet isValid = Validator.mobile('9876543210');\n// isValid = true\n\nisValid = Validator.mobile('5678943210');\n// isValid = false\n```\n\n### PIN (Postal Index Number)\n\nA pincode is a 6 digit numeric code used by Indian Post.\n\n#### Format\n* The first character is a number from `1` to `9`.\n* The second to sixth characters are numberical sequence from `00000` to `99999`.\n\n```js\nlet isValid = Validator.pincode('400001');\n// isValid = true\n\nisValid = Validator.pincode('0123456');\n// isValid = false\n```\n\n### PAN (Permanent Account Number)\n\nA PAN is a 10 digit alphanumeric code issued by Income Tax Department of India.\n\n#### Format\n* The first three characters are alphabetic series running from `AAA` to `ZZZ`.\n* The fourth character represents the status of the PAN holder.\n  * `P` stands for Individual\n  * `C` stands for Company\n  * `H` stands for Hindu Undivided Family (HUF)\n  * `A` stands for Association of Persons (AOP)\n  * `B` stands for Body of Individuals (BOI)\n  * `G` stands for Government Agency\n  * `J` stands for Artificial Juridical Person\n  * `L` stands for Local Authority\n  * `F` stands for Firm/ Limited Liability Partnership\n  * `T` stands for Trust\n* The fifth character represents the first character of the PAN holder's last name/surname in case of an individual. In case of non-individual PAN holders fifth character represents the first character of PAN holder's name.\n* The sixth to ninth characters are sequential numbers running from `0001` to `9999`.\n* The tenth character is an alphabetic check digit.\n\nVisit [this](https://www.incometaxindia.gov.in/Forms/tps/1.Permanent%20Account%20Number%20(PAN).pdf) to know more about PAN.\n\n```js\nlet isValid = Validator.pan('ALWPG5809L');\n// isValid = true\n\nisValid = Validator.pan('ABAB12345Y');\n// isValid = false\n```\n\n### TAN (Tax Deduction and Collection Account Number)\n\nA TAN is a 10 digit alphanumeric code.\n\n#### Format\n* The first four characters are alphabetic series running from `AAAA` to `ZZZZ`.\n* The fifth to ninth characters are sequential numbers running from `00001` to `99999`.\n* The tenth character is an alphabetic character.\n\n```js\nlet isValid = Validator.tan('RAJA99999B');\n// isValid = true\n\nisValid = Validator.tan('RAJA999991');\n// isValid = false\n```\n\n### UAN (Universal Account Number)\n\nA UAN is a 12 digit numberic code that is issued to member of the Employees’ Provident Fund Organisation (EPFO).\n\n```js\nlet isValid = Validator.uan('987654321098');\n// isValid = true\n\nisValid = Validator.uan('A98765432109');\n// isValid = false\n```\n\n### IFSC (Indian Financial System Code)\n\nA IFSC is a 11 digit alphanumberic code that is issued to member of the Employees’ Provident Fund Organisation (EPFO).\n\n#### Format\n* The first four characters are alphabets that denote the bank name.\n* The fifth character is numerical zero (`0`).\n* The sixth to eleventh characters are numerical code that denote the branch name.\n\n\n```js\nlet isValid = Validator.ifsc('SBIN0011569');\n// isValid = true\n\nisValid = Validator.ifsc('BK1D0006046');\n// isValid = false\n```\n\n### ESIC (Employee State Insurance Corporation) Code\n\nA ESIC code is a 17 digit numerical code that is issued by Employee State Insurance Corporation.\n\n```js\nlet isValid = Validator.esic('12345678901234567');\n// isValid = true\n\nisValid = Validator.esic('1234567890123456');\n// isValid = false\n```\n\n### IMEI (International Mobile Equipment Identity)\n\nA IMEI is a 15 digit numeric code to identify mobile phones, as well as some satellite phones.\nThe last digit of IMEI is a Luhn check digit.\n\n```js\nlet isValid = Validator.imei('490154203237518');\n// isValid = true\n\nisValid = Validator.imei('490154203237519');\n// isValid = false\n```\n\n### AADHAAR\n\nAadhaar is a 12 digit numberic code that can be obtained by residents or passport holders of India, based on their biometric and demographic data.\n\n#### Format\n* The first character is a number between `2` and `9`.\n* The second to eleventh characters are random numbers.\n* The twelfth character is a Verhoeff check digit.\n\n```js\nlet isValid = Validator.aadhaar('234567890124');\n// isValid = true\n\nisValid = Validator.aadhaar('187654321096');\n// isValid = false\n```\n\n### AADHAAR VID (Aadhaar Virtual ID)\n\nAadhaar VID is a 16 digit numberic code that can be used instead of Aadhaar number at the time of authentication to avoid sharing of Aadhaar number.\nThe last digit is a Verhoeff check digit.\n\n```js\nlet isValid = Validator.aadhaarVID('9876543210987659');\n// isValid = true\n\nisValid = Validator.aadhaarVID('6234897234982734');\n// isValid = false\n```\n\n### GSTIN (Goods \u0026 Services Tax Identification Number)\n\nA GISTIN is a 15 digit alphanumeric code assigned to a business or person registered under the GST Act.\n\n#### Format\n* The first two characters are numerical series from `01` to `37` denoting state code.\n* The third to twelfth characters are [PAN](#pan-permanent-account-number) number of the GST registered entity.\n* The thirteenth character is a alphabet assigned based on the number of registration within a state.\n* The fourteenth character is `Z` by default.\n* The fifteenth character is a check codeand can be an alphabet or a number.\n\n```js\nlet isValid = Validator.gst('22ALJPT5243L1ZS');\n// isValid = true\n\nisValid = Validator.gst('22ALJPT5243L1ZB');\n// isValid = false\n```\n\n### Vehicle Registration (Number Plate)\n\nA vehicle number plate is an alphanumeric code assigned to a vehicle registered in India.\n\nThe current format of the registration index consists of 4 parts.\n\n#### Format\n* The first two characters are alphanumeric code of the State / Union Territory where the vehicle is registered.\n* The third \u0026 fourth characters the sequential number of a district.\n* The third part consists of one, two or three letters or no letters at all.\n* The fourth part is a number from 1 to 9999, unique to each plate.\n\n```js\nlet isValid = Validator.vehicleRegistration('DL4CAF4943');\n// isValid = true\n\nisValid = Validator.vehicleRegistration('DL4CAF494G');\n// isValid = false\n```\n\n### VPA (Virtual Payment Address)\n\nA VPA / UPI (Unified Payment Interface) ID is a unique id generated for use of UPI in India.\n\n#### Format\n* VPA consists of alphabets, numbers, hyphen (`-`), underscore (`_`) and dot (`.`) as part of identification.\n* The identification part is followed by `@` sign.\n* The last part is the handle of the issuer bank or PSP (Payment Service Provider).\n* The maximum length of VPA is 50 characters.\n\n#### Options\n| Option  | Type | Default | Description |\n| ------------- | ------------- | ------------- | ------------- |\n| maxLength | number | 50 | Maximum length of the VPA address including `@` sign \u0026 the handle. |\n| handles | boolean \\| string[] | false | Whether to do additional check of verifying the handle. \u003cbr/\u003eWhen it is `true` the handle part is checked against default handles listed in [vpa-handles.json](./src/vpa-handles.json). \u003cbr/\u003eWhen it is `string[]` the handle part is checked against merged list of default handles listed in [vpa-handles.json](./src/vpa-handles.json) and the ones given as input. |\n\n```js\nlet isValid = Validator.vpa('amazing-uid@upi');\n// isValid = true\n\nisValid = Validator.vpa('with@at@upi');\n// isValid = false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastermunj%2Fformat-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmastermunj%2Fformat-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastermunj%2Fformat-utils/lists"}