
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
simple-fuzzy
Advanced tools
I’m a software engineer passionate about building fast, efficient, and developer-friendly tools.
This package is part of my journey to create simple yet powerful solutions for everyday dev problems. 🚀
If you wanna support me 👇
If you've ever used Fuse.js, you know it's an amazing, feature-packed fuzzy search library.
It’s powerful, flexible, and works great for large-scale search scenarios.
So why create simple-fuzzy?
Because sometimes you don’t need all that.
In many client-side applications — autocomplete dropdowns, quick search bars, small admin tables — you just want instant results without pulling in a 20KB+ dependency or tweaking dozens of options.
simple-fuzzy is:
If you want a blazing-fast, minimalist fuzzy search that just works out of the box,
simple-fuzzy is the tool for you. 🚀
simple-fuzzyAn extremely fast, lightweight fuzzy search library optimized for small datasets (under 1,000 items).
simple-fuzzy is designed for client-side applications that need blazing-fast fuzzy matching with minimal overhead.
Unlike heavy alternatives, it focuses on one highly-optimized algorithm to deliver instant results for autocomplete, command palettes, and quick-find features.
import Fuse from "fuse.js";
import { createFuzzySearch } from "simple-fuzzy";
const data = Array.from({ length: 1000 }, (_, i) => `item-${i}`);
const fuse = new Fuse(data);
const simpleSearch = createFuzzySearch(data);
console.time("fuse");
fuse.search("item-99");
console.timeEnd("fuse");
console.time("simple-fuzzy");
simpleSearch("item-99");
console.timeEnd("simple-fuzzy");
fuse: 1.5ms
simple-fuzzy: 0.2ms
npm install simple-fuzzy
# or
yarn add simple-fuzzy
import { createFuzzySearch } from "simple-fuzzy";
const fruits = ["apple", "banana", "orange", "grape", "cherry"];
// Create search function
const searchFruits = createFuzzySearch(fruits, { threshold: 5 });
// Search
console.log(searchFruits("aple"));
// Output: ["apple"]
import { createFuzzySearch } from "simple-fuzzy";
interface Book {
title: string;
author: string;
}
const books: Book[] = [
{ title: "The Lord of the Rings", author: "J.R.R. Tolkien" },
{ title: "The Hobbit", author: "J.R.R. Tolkien" },
{ title: "Pride and Prejudice", author: "Jane Austen" },
];
// Search only in the `title` field
const searchBooks = createFuzzySearch(books, { key: "title", threshold: 7 });
console.log(searchBooks("hobit"));
// Output: [{ title: "The Hobbit", author: "J.R.R. Tolkien" }]
import { createFuzzySearch } from "simple-fuzzy";
interface User {
name: string;
email: string;
}
const users: User[] = [
{ name: "Alice Johnson", email: "alice@example.com" },
{ name: "Bob Smith", email: "bob@example.com" },
{ name: "Charlie Brown", email: "charlie@peanuts.com" },
];
// Search in both `name` and `email`
const searchUsers = createFuzzySearch(users, {
key: ["name", "email"],
threshold: 4,
});
console.log(searchUsers("alice"));
// Output: [{ name: "Alice Johnson", email: "alice@example.com" }]
createFuzzySearch<T>(data: T[], options?: FuzzySearchOptions<T>)Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
data | T[] | — | Array of strings or objects to search. |
options.key | keyof T | (keyof T)[] | — | Key(s) to search in if data contains objects. |
options.threshold | number (1–10) | 5 | Match tightness — 1 = loose, 10 = strict. |
Returns:
A function (query: string) => T[] that returns sorted results from best to worst match.
import { createFuzzySearch } from "simple-fuzzy";
// Array of strings - loose match
const fruits = ["apple", "pineapple", "grape", "appletini", "banana", "mango"];
const searchLoose = createFuzzySearch(fruits, { threshold: 2 });
console.log(searchLoose("aple"));
// ["apple", "pineapple", "appletini"]
// Array of strings - tight match
const searchTight = createFuzzySearch(fruits, { threshold: 9 });
console.log(searchTight("aple"));
// ["apple"]
// Array of objects - single key
const users = [
{ name: "Alice Johnson", email: "alice@example.com" },
{ name: "Bob Smith", email: "bob@example.com" },
];
const searchByName = createFuzzySearch(users, { key: "name", threshold: 5 });
console.log(searchByName("alice"));
// [{ name: "Alice Johnson", email: "alice@example.com" }]
// Multiple keys
const searchByNameOrEmail = createFuzzySearch(users, {
key: ["name", "email"],
threshold: 4,
});
console.log(searchByNameOrEmail("bob"));
// [{ name: "Bob Smith", email: "bob@example.com" }]
// Case-insensitive
console.log(searchByName("ALICE"));
// [{ name: "Alice Johnson", email: "alice@example.com" }]
// Empty query returns empty array
console.log(searchByName(""));
// []
MIT © 2025 — Maintained by Sounak Das
FAQs
A fast fuzzy search library for small datasets.
We found that simple-fuzzy demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.