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

mismo-strings

v1.0.1

Published

A lightweight utility to compare the similarity of strings using Dice's Coefficient.

Readme


mismo

Build status License

A lightweight utility that finds the degree of similarity between two strings using Dice’s Coefficient. This algorithm is often more intuitive than Levenshtein distance for natural-language comparison.

Note: mismo-strings is a maintained fork of the original string-similarity library by Ace Aakash. Code is licensed under MIT, with attribution retained as required.


Table of Contents


Usage

For Node.js

Install:

npm install mismo --save

Use in your code:

const stringCompare = require("mismo-strings");

const similarity = stringCompare.compareTwoStrings("healed", "sealed");
// similarity → 0.8

const matches = stringCompare.findBestMatch("healed", [
  "edward",
  "sealed",
  "theatre",
]);
// matches → { ratings: [...], bestMatch: {...}, bestMatchIndex: ... }

For browser apps

Use the UMD build:

<script src="//unpkg.com/mismo/umd/mismo.min.js"></script>
<script>
  stringCompare.compareTwoStrings("what!", "who?");
</script>

This exposes a global variable stringCompare.

Tip: For case-insensitive comparison, you can convert strings to lowercase before comparing:

stringCompare.compareTwoStrings(str1.toLowerCase(), str2.toLowerCase());

API

compareTwoStrings(string1, string2)

Returns a number between 0 and 1 representing similarity (0 = completely different, 1 = identical). Comparison is case-sensitive by default.

Arguments

  1. string1 (string)
  2. string2 (string)

Order does not matter.

Returns

number – similarity score between 0 and 1.

Examples

stringCompare.compareTwoStrings("healed", "sealed");
// → 0.8

stringCompare.compareTwoStrings(
  "Olive-green table for sale, in extremely good condition.",
  "For sale: table in very good condition, olive green in colour."
);
// → 0.6060606060606061

findBestMatch(mainString, targetStrings)

Compares mainString against each string in targetStrings.

Arguments

  1. mainString (string)
  2. targetStrings (Array)

Returns

An object:

{
  ratings: [
    { target: "abc", rating: 0.5 },
    { target: "def", rating: 0.2 },
    ...
  ],
  bestMatch: { target: "abc", rating: 0.5 },
  bestMatchIndex: 0
}

Example

stringCompare.findBestMatch(
  "Olive-green table for sale, in extremely good condition.",
  [
    "For sale: green Subaru Impreza, 210,000 miles",
    "For sale: table in very good condition, olive green in colour.",
    "Wanted: mountain bike with at least 21 gears."
  ]
);

Release Notes

1.0.0 — Initial mismo release

  • Forked from original string-similarity
  • Renamed and repackaged under mismo
  • Updated documentation and cleaned API references
  • Preserved MIT license and attribution

License

MIT — includes original copyright notice from aceakash/string-similarity.