A Node.js package for extracting PAN and Aadhaar card numbers from scanned images using Optical Character Recognition (OCR).
Learn more on Dev.to.
You can install this package using npm:
npm install pan-aadhaar-ocr
Or, if you prefer using yarn:
yarn add pan-aadhaar-ocr
const {extractCardDetails} = require('pan-aadhaar-ocr');
const imagePath = 'path/to/your/image.jpg'; // Pass path to your PAN/Aadhaar image
const cardType = 'PAN'; // Card type can either be `PAN` or `AADHAAR`
extractCardDetails(imagePath, cardType)
.then((extractedDetails) => {
console.log(`PAN Number: ${extractedDetails.Number}`);
})
.catch((err) => {
console.error(err);
});
You can also use async-await:
try {
const extractedDetails = await extractCardDetails(imagePath, cardType);
console.log(extractedDetails);
} catch (err) {
console.error('Something went wrong while extracting card details');
}
PAN
PAN (Permanent Account Number) is a unique ten-character alphanumeric identifier issued by the Income Tax Department of India. It is widely used for financial and tax-related purposes.
AADHAAR
Aadhaar is a 12-digit unique identity number issued by the Unique Identification Authority of India (UIDAI). It is used for various government and private sector services and is a crucial identification document in India.
For KYC processes, use the following API to validate PAN and AADHAAR:
Contributions are welcome! Feel free to open issues or submit pull requests.
This module is authored by Vinit Shahdeo and licensed under the MIT License.
Made with ❤️ by @vinitshahdeo for India 🇮🇳 |