![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
fuzzbunny
is a small (1k), fast & memory efficient fuzzy string searching/matching/highlighting library.
It works equally well in a browser environment or Node.js.
Other similar libraries are fuzzymatch, fuzzy, fuzzy-search, fuzzyjs.
fuzzbunny
aims to be nimble and fast. It has a simple api that can easily be integrated with any frontend library to build great search UI. We use it at mixpanel.com to power our UI dropdowns and tables.
npm install --save fuzzbunny
or yarn add fuzzbunny
Fuzzbunny Gutenberg Catalog Demo →
const {fuzzyFilter, fuzzyMatch} = require(`fuzzbunny`);
// or import {fuzzyFilter, fuzzyMatch} from 'fuzzbunny';
const heroes = [
{
name: `Claire Bennet`,
ability: `Rapid cellular regeneration`,
},
{
name: `Micah Sanders`,
ability: `Technopathy`,
},
{
name: `Hiro Nakamura`,
ability: `Space-time manipulation`,
},
{
name: `Peter Petrelli`,
ability: `Tactile power mimicry`,
},
];
// Use fuzzyFilter to filter an array of items on specific fields and get filtered + score-sorted results with highlights.
const results = fuzzyFilter(heroes, `stm`, {fields: [`name`, `ability`]});
/*
results = [
{
item: {
name: 'Peter Petrelli',
ability: 'Tactile power mimicry',
},
score: 1786,
highlights: {
ability: ['', 'T', 'actile power ', 'm', 'imicry'],
},
},
{
item: {
name: 'Hiro Nakamura',
ability: 'Space-time manipulation',
},
score: 983,
highlights: {
ability: ['Space-', 't', 'ime ', 'm', 'anipulation'],
},
},
];
*/
// Use fuzzyMatch to match a single string to get score + highlights. Returns null if no match found.
const match = fuzzyMatch(heroes[0].name, `ben`);
/*
match = {
score: 2893,
highlights: ['Claire ', 'Ben', 'net'],
};
*/
fuzzbunny
uses a scoring algorithm that prioritizes following signals. See _getMatchScore
function.
Example 1:
{Mayfl}ower
ranks above The {Mayfl}ower
The {Mayfl}ower
ranks above Story of the {Mayfl}ower
The {Mayfl}ower
ranks above {May} {fl}ower
The {May} {fl}ower
ranks above This {May} {fl}ower
Example 2:
const f = require(`fuzzbunny`);
f.fuzzyMatch(`Gobbling pupusas`, `usa`);
// {score: 2700, highlights: ['Gobbling pup', 'usa', 's']}
f.fuzzyMatch(`United Sheets of Antarctica`, `usa`);
// {score: 2276, highlights: ['', 'U', 'nited ', 'S', 'heets of ', 'A', 'ntarctica']}
Gobbling pup{usa}s
wins because 3 letter contiguous sequence yields a higher score.
NOTE: fuzzbunny
optmizes for meaningful results. It only does substring/prefix/acronym-matching, not greedy matching.
This is because humans brains are great at prefix recall.
e.g words that start with "ca" are much easier to recall than words that contain the letters "c" and "a" somewhere.
It's easy to remember that {usa}
stands for {U}nited {S}tates of {A}merica
, not F{u}ll Java{s}cript Fr{a}mework
fuzzbunny
matches ~ million lines/second on modern hardware. Tested on 2018 MacBook Pro with 2.4Ghz CPU.
See tests/performance.js
fuzzbunny
comes with autogenerated TypeScript types. See index.d.ts
FAQs
Fast fuzzy string matching with scoring and matched ranges
The npm package fuzzbunny receives a total of 1,457 weekly downloads. As such, fuzzbunny popularity was classified as popular.
We found that fuzzbunny demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.