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

docscanr

v0.2.0

Published

Secure OCR toolkit for fintech document processing with confidence scoring

Readme

docscanr

Secure OCR toolkit for document processing. Extracts structured fields from images with per-field confidence scoring. Supports Indian KYC/identity documents.

Features

  • PAN Card — PAN number, Name, Father's Name, DOB
  • Aadhaar Card — Aadhaar number (masked), Name, DOB, Gender, Address
  • Passport — Passport number, Name, DOB, Gender, Expiry, Place of Birth, Nationality
  • Voter ID — EPIC number, Name, Father/Husband Name, DOB, Gender, Address
  • Bank Cheque — IFSC, Account Number, Bank Name, MICR, Cheque Number
  • Confidence Scoring — Per-field + document-level (0-1)
  • Security-first design — Built for fintech compliance

Install

npm install docscanr

Requires Node.js >= 20.9 (server-side only, not for browser)

Usage

import { OCRToolkit } from 'docscanr';

const toolkit = new OCRToolkit();

// Extract raw text from any image
const result = await toolkit.extractText('./document.jpg');
console.log(result.text);
console.log(result.confidence); // 0.87

// Parse PAN Card
const pan = await toolkit.parseOVD('./pan-card.jpg', 'pan');
console.log(pan.fields.panNumber);   // { value: "ABCDE1234F", confidence: 0.95 }
console.log(pan.fields.name);        // { value: "Rahul Kumar", confidence: 0.85 }
console.log(pan.fields.dateOfBirth); // { value: "15/03/1995", confidence: 0.90 }
console.log(pan.isValid);            // true

// Parse Aadhaar (front, back, or merged — auto-detects)
const aadhaar = await toolkit.parseOVD('./aadhaar.jpg', 'aadhaar');
console.log(aadhaar.fields.aadhaarNumber); // { value: "XXXX XXXX 1234", confidence: 0.92 }
console.log(aadhaar.fields.name);          // { value: "John Doe", confidence: 0.85 }
console.log(aadhaar.fields.gender);        // { value: "Male", confidence: 0.90 }

// Parse Bank Cheque
const cheque = await toolkit.parseOVD('./cheque.jpg', 'cheque');
console.log(cheque.fields.ifscCode);      // { value: "HDFC0001234", confidence: 0.93 }
console.log(cheque.fields.accountNumber); // { value: "12345678901234", confidence: 0.80 }
console.log(cheque.fields.bankName);      // { value: "HDFC Bank", confidence: 0.92 }

Configuration

const toolkit = new OCRToolkit({
  security: {
    maxFileSize: 5 * 1024 * 1024, // 5MB limit
  },
  maskSensitiveData: true, // Mask Aadhaar numbers (default: true)
});

Confidence Scoring

| Score | Meaning | |-------|---------| | 0.9+ | High confidence — strong pattern match | | 0.7–0.9 | Medium — likely correct | | 0.5–0.7 | Low — needs manual review | | < 0.5 | Very low — likely incorrect |

Supported Formats

JPEG, PNG, WebP, TIFF

API

toolkit.extractText(input, options?)

Extract raw text from an image.

  • input — File path (string) or image Buffer
  • Returns: { text, confidence, processingTimeMs }

toolkit.parseOVD(input, type, options?)

Parse a document into structured fields.

  • input — File path (string) or image Buffer
  • type'pan' | 'aadhaar' | 'cheque' | 'passport' | 'voter-id'
  • Returns: { documentType, documentConfidence, fields, isValid, validationErrors, processingTimeMs }

License

MIT