Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
format-utils
Advanced tools
Readme
Utilities for validating various formats of Indian system codes like Mobile, PAN, AADHAAR, GST and more!
npm install format-utils --save
const { Validator } = require('format-utils');
OR
import { Validator } from 'format-utils';
A mobile is a 10 digit numerical code starting with either 6, 7, 8, 9.
let isValid = Validator.mobile('9876543210');
// isValid = true
isValid = Validator.mobile('5678943210');
// isValid = false
A pincode is a 6 digit numeric code used by Indian Post.
1
to 9
.00000
to 99999
.let isValid = Validator.pincode('400001');
// isValid = true
isValid = Validator.pincode('0123456');
// isValid = false
A PAN is a 10 digit alphanumeric code issued by Income Tax Department of India.
AAA
to ZZZ
.P
stands for IndividualC
stands for CompanyH
stands for Hindu Undivided Family (HUF)A
stands for Association of Persons (AOP)B
stands for Body of Individuals (BOI)G
stands for Government AgencyJ
stands for Artificial Juridical PersonL
stands for Local AuthorityF
stands for Firm/ Limited Liability PartnershipT
stands for Trust0001
to 9999
.Visit this to know more about PAN.
let isValid = Validator.pan('ALWPG5809L');
// isValid = true
isValid = Validator.pan('ABAB12345Y');
// isValid = false
A TAN is a 10 digit alphanumeric code.
AAAA
to ZZZZ
.00001
to 99999
.let isValid = Validator.tan('RAJA99999B');
// isValid = true
isValid = Validator.tan('RAJA999991');
// isValid = false
A UAN is a 12 digit numberic code that is issued to member of the Employees’ Provident Fund Organisation (EPFO).
let isValid = Validator.uan('987654321098');
// isValid = true
isValid = Validator.uan('A98765432109');
// isValid = false
A IFSC is a 11 digit alphanumberic code that is issued to member of the Employees’ Provident Fund Organisation (EPFO).
0
).let isValid = Validator.ifsc('SBIN0011569');
// isValid = true
isValid = Validator.ifsc('BK1D0006046');
// isValid = false
A ESIC code is a 17 digit numerical code that is issued by Employee State Insurance Corporation.
let isValid = Validator.esic('12345678901234567');
// isValid = true
isValid = Validator.esic('1234567890123456');
// isValid = false
A IMEI is a 15 digit numeric code to identify mobile phones, as well as some satellite phones. The last digit of IMEI is a Luhn check digit.
let isValid = Validator.imei('490154203237518');
// isValid = true
isValid = Validator.imei('490154203237519');
// isValid = false
Aadhaar is a 12 digit numberic code that can be obtained by residents or passport holders of India, based on their biometric and demographic data.
2
and 9
.let isValid = Validator.aadhaar('234567890124');
// isValid = true
isValid = Validator.aadhaar('187654321096');
// isValid = false
Aadhaar 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. The last digit is a Verhoeff check digit.
let isValid = Validator.aadhaarVID('9876543210987659');
// isValid = true
isValid = Validator.aadhaarVID('6234897234982734');
// isValid = false
A GISTIN is a 15 digit alphanumeric code assigned to a business or person registered under the GST Act.
01
to 37
denoting state code.Z
by default.let isValid = Validator.gst('22ALJPT5243L1ZS');
// isValid = true
isValid = Validator.gst('22ALJPT5243L1ZB');
// isValid = false
A vehicle number plate is an alphanumeric code assigned to a vehicle registered in India.
The current format of the registration index consists of 4 parts.
let isValid = Validator.vehicleRegistration('DL4CAF4943');
// isValid = true
isValid = Validator.vehicleRegistration('DL4CAF494G');
// isValid = false
A VPA / UPI (Unified Payment Interface) ID is a unique id generated for use of UPI in India.
-
), underscore (_
) and dot (.
) as part of identification.@
sign.Option | Type | Default | Description |
---|---|---|---|
maxLength | number | 50 | Maximum length of the VPA address including @ sign & the handle. |
handles | boolean | string[] | false | Whether to do additional check of verifying the handle. When it is true the handle part is checked against default handles listed in vpa-handles.json. When it is string[] the handle part is checked against merged list of default handles listed in vpa-handles.json and the ones given as input. |
let isValid = Validator.vpa('amazing-uid@upi');
// isValid = true
isValid = Validator.vpa('with@at@upi');
// isValid = false
FAQs
Utilities for validating various formats of Indian system codes like Mobile, PAN, AADHAAR, GST and more!
The npm package format-utils receives a total of 325 weekly downloads. As such, format-utils popularity was classified as not popular.
We found that format-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.