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

fuzzy-name-match

v1.0.2

Published

A fuzzy name matching utility for Node.js

Readme

Fuzzy Name Match

A lightweight and flexible fuzzy name matching library for Node.js, designed to handle variations, abbreviations, and reversed orders in personal names.

npm version License: MIT

Features

  • Name-Specific Matching: Handles reversed names, abbreviations, and spacing variations
  • Configurable Thresholds: Control sensitivity of matches
  • Abbreviation Support: Detects and matches initials against full names
  • Flexible Comparison: Compare single pairs or batches of names
  • Lightweight: No heavy dependencies, works fast with Node.js projects

Installation

npm install fuzzy-name-match

Quick Start

const { nameMatchResult } = require('fuzzy-name-match');

// Compare two names and get detailed result
const result = nameMatchResult('Mr. Adam George Clooney', 'Adam G Clooney');

console.log(result);
/*
{
  result: true,
  score: 84.85,
  name_1: 'Mr. Adam George Clooney',
  name_2: 'Adam G Clooney',
  normalised_name_1: 'adam george clooney',
  normalised_name_2: 'adam g clooney'
}
*/

Detailed Usage

With Initials

import { nameMatchResult } from "fuzzy-name-match";

const result = nameMatchResult("S. Tendulkar", "Sachin Tendulkar");

console.log(result.result); // true
console.log(result.score);  // ~85

No Match

const result = nameMatchResult("Virat Kohli", "Rohit Sharma");
console.log(result.result); // false

Configuration

You can fine-tune the matching behavior using an optional config object:

interface INameMatchConfig {
  firstNameWeightage?: number;     // Weight given to first name (default: 70)
  reverseScoreThreshold?: number;  // Threshold for reverse name order (default: 90)
  nameMatchThreshold?: number;     // Final match threshold (default: 80)
}

Example with Config

const result = nameMatchResult("Ramesh Kumar", "Kumar Ramesh", {
  nameMatchThreshold: 85,
  reverseScoreThreshold: 85,
});

console.log(result);
/*
{
  result: true,
  score: 90,
  ...
}
*/

Return Format

Each call to nameMatchResult returns:

interface INameMatchResult {
  result: boolean;          // true if names match above threshold
  score: number;            // similarity score (0–100)
  name_1: string;           // original input name 1
  name_2: string;           // original input name 2
  normalised_name_1: string; // lowercased + cleaned name1
  normalised_name_2: string; // lowercased + cleaned name2
}

Use Cases

  • Data cleaning: Matching customer names across multiple databases.
  • Banking/Finance: Identifying duplicate KYC records.
  • Education: Matching student records where names are spelled differently.
  • E-commerce: Deduplicating customer accounts.

Challenges Handled

  • Reversed names (first last vs last, first)
  • Abbreviations and initials
  • Middle names and missing parts
  • Spacing and case variations
  • Common nickname handling (configurable)

License

MIT