0.2.0 • Published 9 years ago

properjs-isearch v0.2.0

Weekly downloads
1
License
-
Repository
github
Last release
9 years ago

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
0.2.0

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago