Skip to content

Module to validate Indian mobile numbers, Aadhaar, PAN, GST, etc.

License

Notifications You must be signed in to change notification settings

soheltarir/node-validate-india

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-validate-india

Module to validate and retrieve Indian mobile numbers, Aadhaar, PAN, GST, etc.

npm version

Installation

npm install validate-india --save

Validations

Below are the list of currently supported documents:

  • Aadhaar
  • Mobile Number
  • PAN
  • GST
  • Bank IFSC
  • ESIC
  • UAN

Retrieval

Below are the list of current supported documents from which data can be retrieved from an image:

  • Aadhaar
  • PAN

Data from image is extracted using the Google's Vision API, hence, to use this feature you must have a Google Developers account and the environment variable GOOGLE_APPLICATION_CREDENTIALS should be set to point to the file path of the JSON file that contains your service account key. For more details refer the link: Google Documentation

Usage

Javascript

Below is an example of simple validation

var pan = require('validate-india').pan;

if (pan.isValid('BMEQ0056N')) {
    console.log('Valid PAN provided');
} else {
    console.log('Invalid PAN provided');
}

Below is an example of retrieval of PAN number using OCR

var pan = require('validate-india').pan;

pan.extractFromImage('[ImageURL]').then(res => console.log('PAN Number:', res));

Typescript

Below is an example of simple validation

import { pan } from 'validate-india';

f (pan.isValid('BMEQ0056N')) {
    console.log('Valid PAN provided');
} else {
    console.log('Invalid PAN provided');
}

Below is an example of retrieval of PAN number using OCR

import { pan } from 'validate-india';

const value = await pan.extractFromImage('[ImageURL]');
console.log('PAN Number:', value);

To-Do List

  • Extract Full Name, Father's Name and Date of Birth from PAN using OCR.
  • Extract Full Name, Date of Birth and Gender from Aadhaar Image using OCR.

About

Module to validate Indian mobile numbers, Aadhaar, PAN, GST, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published