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 🙏

© 2024 – Pkg Stats / Ryan Hefner

near-duplicates

v0.2.0

Published

A TypeScript npm package for finding near duplicate string pairs

Downloads

326

Readme

near-duplicates

CI NPM Version

A TypeScript npm package to find near duplicate pairs in a string set.

Usage

npm install near-duplicates
import { findNearDuplicates } from "near-duplicates";

findNearDuplicates(["hello", "hallo", "halo"]);

// you can also specify a threshold for the maximum distance
// if not specified, it will be a default value of 12
findNearDuplicates(["hello", "hallo", "halo"], 2);

Benchmarks

Here's a benchmark of the performance of findNearDuplicates using the default max distance of 12.

 DEV  v2.1.4 near-duplicates

 ✓ test/index.bench.ts (5) 5211ms
   ✓ findNearDuplicates (5) 5210ms
     name                                       hz     min      max     mean      p75      p99     p995     p999     rme  samples
   · small strings                      214,439.85  0.0043   0.2387   0.0047   0.0046   0.0053   0.0071   0.0592  ±0.38%   107220   fastest
   · 10 random strings (20-500 chars)    29,533.57  0.0148   0.2318   0.0339   0.0369   0.0557   0.1355   0.1764  ±0.58%    14767
   · 100 random strings (20-500 chars)    1,469.32  0.5852   1.3275   0.6806   0.6818   1.1802   1.1990   1.3275  ±1.05%      735
   · 500 random strings (20-500 chars)     98.7281  9.1328  11.3120  10.1288  10.8487  11.3120  11.3120  11.3120  ±2.03%       50
   · 2k random strings (20-500 chars)       6.2139  155.68   173.60   160.93   162.18   173.60   173.60   173.60  ±2.25%       10   slowest