kentcdodds/match-sorter

Simple, expected, and deterministic best-match sorting of an array in JavaScript

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 1 hour ago
Type:Library / SDKCategory(s):Core & Utility LibrariesLanguages & Runtimes
Added to GitGenius on September 16th, 2026
Created on August 25th, 2016
Open Issues & Pull Requests: 5 (+0)
GitHub issues: Enabled
Number of forks: 143
Total Stargazers: 4,107 (+0)
Total Subscribers: 27 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 6.0 hours
Mean response time: 86.8 days
90th percentile: 3.2 days
Tracked items: 10

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 4
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 969 days
Stale 30+ days: 4
Stale 90+ days: 4

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • released (4)
  • help wanted (1)
  • needs investigation (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

match-sorter is a sorting utility that ranks array items by relevance to a search query.

The tool solves the problem of presenting search results in an order that matches user expectations. Rather than returning matches in arbitrary order, match-sorter applies a ranking algorithm that prioritizes exact matches, then case-insensitive matches, then substring matches at the beginning of fields, and finally substring matches anywhere in the content. This deterministic approach means the same query always produces the same result order, making the behavior predictable for both developers and end users.

The project suits applications that need search functionality without the complexity of full-text search engines or external services. It works well for filtering lists, autocomplete fields, and command palettes where the dataset is small enough to fit in memory. Developers should choose this tool when they want simple, fast client-side ranking without configuration overhead. The README does not name alternative libraries for comparison.

The project shows consistent maintenance with regular updates addressing edge cases and improving the matching algorithm. Pull requests receive timely review and feedback. Issues are actively triaged and resolved, indicating sustained attention to user-reported problems. The codebase maintains high test coverage, reflecting a commitment to reliability as new features and fixes are added.