Skip to content

A small lib for matching text searches by relevance

Notifications You must be signed in to change notification settings

alexandrepalagem/does-match

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DoesMatch

A small lib for matching text searches by relevance.

Live demo.

Installation

npm install does-match

Usage

CommonsJS

var doesMatch = require('does-match');
doesMatch(text, query);

Browser global

doesMatch(text, query);

Example

Matching songs names to match a search and order by relevance:

var doesMatch = require('does-match');
var search = 'somebody to love';

doesMatch('Somebody To Love', search); // 64
doesMatch('To Love Somebody', search); // 24
doesMatch('Use Somebody', search); // 16
doesMatch('One Way Road', search); // 0

About

A small lib for matching text searches by relevance

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 44.8%
  • CSS 42.0%
  • HTML 13.2%