Nutritious Polygonal Meatball

properjs-isearch

0.2.0 • Public • Published

Isearch

Fast expression matching for term lists. Search and filter.

Installation

npm install properjs-isearch --save-dev

Usage

var Isearch = require( "properjs-isearch" );
 
// Array of terms, could be from a request
var terms = ["foo", "bar", "baz", "bot"];
var input = document.getElementById( "myInput" );
 
// Init isearch with this term catalogue
var isearch = new Isearch({
    terms: terms
});
 
// Compare user input against terms
input.addEventListener( "keyup", function () {
    isearch.query( this.value, function ( matches ) {
         // Do stuff with matches here
    });
 
}, false );

Options

  • terms
  • escapeInputs
  • matchFront
  • matchCase
  • alphaResults
  • processMatches( regex )
    • Provide a unique method to match items in different ways

install

npm i properjs-isearch

Downloadsweekly downloads

2

version

0.2.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability