match-sorter is a small JavaScript library that takes a list of items and returns them sorted by how well they match a given search query. It is designed to produce “simple, expected, and deterministic” results so users see intuitive matches instead of opaque fuzzy scores. The core API accepts arrays of strings or objects and returns a filtered, ranked list, making it a natural fit for search boxes, autocomplete components, and table filtering. It supports a variety of advanced options, such as specifying which object keys to search, controlling the matching threshold, and customizing the base sorting logic. The library includes recipes and examples that show how to handle different naming conventions like PascalCase, camelCase, snake_case, and kebab-case by normalizing separators. It also offers control over diacritics handling, allowing you to strip or keep accents depending on the UX you want. Distributed via npm and usable in both Node and browser environments.

Features

  • Deterministic best-match sorting for arrays of strings or objects based on a search query
  • Flexible key configuration so you can match across multiple fields in complex objects
  • Configurable matching behavior with options like threshold, keepDiacritics, baseSort, and sorter
  • Built-in support and recipes for handling different naming conventions (PascalCase, camelCase, snake_case, kebab-case)
  • Works seamlessly for multi-word queries and table-style filtering where matches can span multiple columns
  • Distributed via npm, usable in Node or browser builds, with examples and demos for quick integration

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow match-sorter

match-sorter Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of match-sorter!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Libraries

Registered

2025-11-26