fuzzball.js
micromatch
fuzzball.js | micromatch | |
---|---|---|
2 | 4 | |
502 | 2,618 | |
- | 0.8% | |
4.1 | 4.4 | |
9 days ago | 12 days ago | |
JavaScript | JavaScript | |
GNU General Public License v3.0 only | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
fuzzball.js
-
Unlocking Advanced RAG: Citations and Attributions
import { ratio, } from 'fuzzball'; import { SequenceMatcher } from 'difflib'; // modified from: https://github.com/nol13/fuzzball.js/blob/773b82991f2bcacc950b413615802aa953193423/fuzzball.js#L942 function partial_ratio(str1: string, str2: string) { if (str1.length <= str2.length) { var shorter = str1 var longer = str2 } else { var shorter = str2 var longer = str1 } var m = new SequenceMatcher(null, shorter, longer); var blocks = m.getMatchingBlocks(); let bestScore: number = 0; let bestMatch: string | null = null let bestStartIdx: number = -1 for (var b = 0; b < blocks.length; b++) { var long_start = (blocks[b][1] - blocks[b][0]) > 0 ? (blocks[b][1] - blocks[b][0]) : 0; var long_end = long_start + shorter.length; var long_substr = longer.substring(long_start,long_end); var r = ratio(shorter,long_substr); if (r > bestScore) { bestScore = r; bestMatch = long_substr; bestStartIdx = long_start; } if (r > 99.5) { break; } } return { bestMatch, bestScore, bestStartIdx, } }
-
I'm thinking of making a search tool to find Dunkey quotes. Here is a very early prototype. More details in comment.
I’ve been using the fuzzball package for the search algorithm in my current project. It might be able to help with matching non-exact strings
micromatch
-
A CLI for developing in monorepos, not building them
Packages on the RHS can contain wildcards, but must be escaped with brackets if so. We use micromatch for matching. Refer to their documentation for questions on matching behavior and available functionality.
-
Control your npm dependencies
All of the downloads are from an old version of https://github.com/micromatch/micromatch.
-
NPM – is-even, 160k weekly downloads
https://github.com/i-voted-for-trump/
> i-voted-for-trump
> This is a joke. You'll only see this org if you are attempting to troll me about repositories I created when I was learning to program.
> is-odd
> I created this in 2014, the year I learned how to program. All of the downloads are from an old version of https://github.com/micromatch/micromatch. I've done a few other things since: https://xn--gith-tc7a
-
BREAKING!! NPM package ‘ua-parser-js’ with more than 7M weekly download is compromised
Since then they've made things that are IMO quite useful, like enquirer, micromatch, and remarkable.
What are some alternatives?
ZLOOKUP - Google Sheet Fuzzy String Matching Function
picomatch - Blazing fast and accurate glob matcher written JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. Used by GraphQL, Jest, Astro, Snowpack, Storybook, bulma, Serverless, fdir, Netlify, AWS Amplify, Revogrid, rollup, routify, open-wc, imba, ava, docusaurus, fast-glob, globby, chokidar, anymatch, cloudflare/miniflare, pts, and more than 5 million projects! Please follow picomatch's author: https://github.com/jonschlinkert
js-levenshtein - The most efficient JS implementation calculating the Levenshtein distance, i.e. the difference between two strings.
is-even - I created this in 2014, when I was learning how to program.
wildflower - Efficient wildcard matching against strings
emoji-regex - A regular expression to match all Emoji-only symbols as per the Unicode Standard.
is-number - JavaScript/Node.js utility. Returns `true` if the value is a number or string number. Useful for checking regex match results, user input, parsed strings, etc.
is-odd - I created this in 2014, the year I learned how to program. All of the downloads are from an old version of https://github.com/micromatch/micromatch. I've done a few other things since: https://github.com/jonschlinkert.
GHSA-pjwm-rvh2-c87w
enquirer - Stylish, intuitive and user-friendly prompts, for Node.js. Used by eslint, webpack, yarn, pm2, pnpm, RedwoodJS, FactorJS, salesforce, Cypress, Google Lighthouse, Generate, tencent cloudbase, lint-staged, gluegun, hygen, hardhat, AWS Amplify, GitHub Actions Toolkit, @airbnb/nimbus, and many others! Please follow Enquirer's author: https://github.com/jonschlinkert
xUnit - xUnit.net is a free, open source, community-focused unit testing tool for .NET.
deno - A modern runtime for JavaScript and TypeScript.