JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 147887
  • Score
    100M100P100Q214669F
  • License ISC

Simple fuzzy search

Package Exports

  • fuzzy-search

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fuzzy-search) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Fuzzy search

Travis npm npm Coveralls

Simple fuzzy search

Installation

Using npm

npm install fuzzy-search --save

Using <script>

<script src="fuzzy-search.min.js"></script>

Quick start guide

// This can be excluded when loaded via <script>
import FuzzySearch from 'fuzzy-search'; // Or: var FuzzySearch = require('fuzzy-search');

var people = [{
  name: {
    firstName: 'Jesse',
    lastName: 'Bowen',
  },
  state: 'Seattle',
}];

var fuzzy = new FuzzySearch(people, ['name.firstName', 'state'], {
  caseSensitive: true,
});
var result = fuzzy.search('ess');

Documentation

var fuzzy = new FuzzySearch(<haystack>, [keys], [options]);
var result = fuzzy.search(<needle>);

<hackstack>

(Array) Array of objects containing the search list

[keys]

(Array) List of properties that will be searched. This also supports nested properties.

[options]

(Object) Object with options that will configure the search

<needle>

(String) The string to search on

Options

caseSensitive (type: Boolean)

Indicates whether comparisons should be case sensitive.