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

name-match-advanced

v1.3.6

Published

A Powerful robust name matching utility with initials handling and fuzzy logic useful for fintech and insurance kyc, ocr and crm

Readme

name-match-advanced


🚀 Live Interactive Demo:
👉


A Most Powerful robust name matching library for Node.js and TypeScript that combines multiple strategies — initials handling, token swapping, fuzzy similarity, and prefix normalization — for accurate name matching in fintech, insurance, CRM, KYC, OCR and other applications.

npm version Test Coverage TypeScript JavaScript License: MIT


Features

  • Multi-strategy Matching: Combines exact match, initials handling, swapped tokens, and fuzzy Levenshtein similarity.
  • Prefix Normalization: Removes common prefixes like Mr, Mrs, Dr, Shri, Smt, etc.
  • Initials Expansion & Merge: Converts K.S.KS, KSK S, or merges initials intelligently.
  • Swapped Tokens Handling: Recognizes names in different order (e.g., "Vijay Kumar Sharma" → "Sharma Vijay Kumar" "Vijay Kumar Sharma" → "Vijay K S").
  • Scoring System: Returns percentage similarity and descriptive remarks: Exact Match, High Similarity, Possible Match, Low Match.
  • Fuzzy Matching: Handles typos and variations using Levenshtein distance.
  • Node.js & TypeScript Ready: Works in JS, TS, and frameworks like Next.js.

Installation

npm install name-match-advanced

Or yarn:

yarn add name-match-advanced

Quick Start (JavaScript)

const { matchNames } = require('name-match-advanced');

const result = matchNames('Sagar Kumar Jangid', 'Sagar Kumar J');

console.log(result);
/*
{
  inputName: 'Sagar Kumar Jangid',
  givenName: 'Sagar Kumar J',
  percentage: 95,
  remark: 'High Similarity'
}
*/

TypeScript Example

import { matchNames } from 'name-match-advanced';

const result = matchNames('Sagar Kumar Jangid', 'Sagar Kumar J');

console.log(result);
/*
{
  inputName: 'Sagar Kumar Jangid',
  givenName: 'Sagar Kumar J',
  percentage: 95,
  remark: 'High Similarity'
}
*/

Next.js API Example

// pages/api/match.ts
import type { NextApiRequest, NextApiResponse } from 'next';
import { matchNames } from 'name-match-advanced';

export default function handler(req: NextApiRequest, res: NextApiResponse) {
  const { inputName, givenName } = req.query;

  if (!inputName || !givenName) {
    return res.status(400).json({ error: 'inputName and givenName are required' });
  }

  const result = matchNames(inputName as string, givenName as string);
  res.status(200).json(result);
}

/*
Request:
GET /api/match?inputName=Gowri%20K%20S&givenName=GOWRI%20KS

Response:
{
  "inputName": "Gowri K S",
  "givenName": "GOWRI KS",
  "percentage": 100,
  "remark": "Exact Match"
}
*/

Advanced Usage

import { matchNames } from 'name-match-advanced';

const examples = [
  { input: 'K S Gowri', given: 'Gowri K S' },
  { input: 'Yadav Vijaysinh Ishwarsinh', given: 'VIJAYSINH ISHWARSINH YADAV' },
  { input: 'Shilpa Deshpande', given: 'Shilpa P Deshpande' }
];

examples.forEach(({ input, given }) => {
  const result = matchNames(input, given);
  console.log({ input, given, result });
});

/*
Sample Output:

{ input: 'K S Gowri', given: 'Gowri K S', result: { inputName: 'K S Gowri', givenName: 'Gowri K S', percentage: 99, remark: 'High Similarity' } }

{ input: 'Yadav Vijaysinh Ishwarsinh', given: 'VIJAYSINH ISHWARSINH YADAV', result: { inputName: 'Yadav Vijaysinh Ishwarsinh', givenName: 'VIJAYSINH ISHWARSINH YADAV', percentage: 100, remark: 'Exact Match' } }

{ input: 'Shilpa Deshpande', given: 'Shilpa P Deshpande', result: { inputName: 'Shilpa Deshpande', givenName: 'Shilpa P Deshpande', percentage: 85, remark: 'Possible Match' } }
*/

How It Works

  1. Matching Strategies

    • Exact Match → 100%
    • Swapped Token Match → 99%
    • Full Token Containment → 90–99%
    • Fuzzy Levenshtein Match → 60–95%
    • Initial-only Downgrade → Avoids false positives
  2. Scoring & Remark

    • 100 → Exact Match
    • 90–99 → High Similarity
    • 70–89 → Possible Match
    • <70 → Low Match

Challenges Handled

  • Different name orders (first last vs. last, first)
  • Middle names and initials
  • Nicknames and formal names
  • Suffixes (Jr, Sr, III)
  • Titles and prefixes (Mr, Dr, Smt)
  • Hyphenated or compound names
  • Case differences, spacing variations, special characters

License

MIT License © 2026 vspro


Keywords

name-matching, name-matching-kyc, name-matching-ocr, fuzzy-match, initials, levenshtein, typescript, nodejs, nextjs, npm-package, name-validation, crm, fintech, insurance, KYC, OCR, CRM