3.2.1 • Published 6 years ago

fuzzy-search v3.2.1

Weekly downloads
54,291
License
ISC
Repository
github
Last release
6 years ago

Fuzzy search

Simple lightweight Fuzzy Search library written in JavaScript, with zero dependencies!

Travis npm npm Donate

Installation

Using npm

npm install fuzzy-search --save

Using <script>

<script src="FuzzySearch.js"></script>

Quick start guide

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

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

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

Documentation

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

haystack (type: Array)

Array of objects containing the search list.


keys (type: Array, default: [])

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


options (type: Object)

Object with options that will configure the search. Scroll/Swipe down to see more information on what options are available.


\<needle> (type: String, default: '')

The string to Fuzzy Search on.

Options

caseSensitive (type: Boolean, default: false)

Indicates whether comparisons should be case sensitive.

sort (type: Boolean, default: false)

When true it will sort the results by best match (when searching for abc in the search set ['a__b__c', 'abc'] it would return abc as the first result).

When false it will return the results in the original order.

dafunda-markdown-editor@midigator/styleguidealfred-emoji-localkontenbase-document-editorchonky-trrsytchonky-trryst@visualbi/ibcs-charts@infinitebrahmanuniverse/nolb-fuz@everything-registry/sub-chunk-1713tw-file-browser@routr/ctlkalamakalama-mplayerhello-world-editorgraphql-mock-data-generatorlicensemarktownkv-custom-chonky@wcjx/editor@wedevign/markdown-editor@wedevign/rich-markdown-editor@wedevign/rich-markdown-editor-2@thoughtback/rich-markdown-editor@tw-material/file-browser@teldrive-jp/file-browser@teldrive_jp/tw-file-browser@vladimir.medina/chonkyallkeyshop-apianue-cli@gtsc/libs-shared@gtsc/building-block-auditable-item-graph@gtsc/building-block-authentication@gtsc/building-block-document-management@gtsc/api-core@gtsc/api-fastify@hackernoon/rich-markdown-editor@guilleamutio/gitp@codetez/react-file-manager-ctz@complai/chonky@comparto/git-c@algoraven/crypto@compensa/rich-markdown-editor@akord/rich-markdown-editorstyllo-markdown-editorvue-pancake-icons@bhunter179/chonky@brizy/ui@brightlever/chonky@broncha/rich-markdown-editor@brainfish-ai/rich-markdown-editorzandorblipyoursoftrun-componentszerfznotes-editor@kyna/editor@liwuming/rich-editor@moaazsidat/rich-markdown-editor@raven-crypto/raven-crypto@povio/ui-kit@samuelncui/chonky@pick-chunks/pc@pnegahdar/rich-markdown-editor@paragraph-xyz/rich-markdown-editor@rolebase/editormusic-instrumentsmetro-visualizernuchonkyopen-in-vscodeparatechchonkyrsharp-clireact-emoji-popup-listersats-ui-libselektorsaber-plugin-local-searchreact-hook-fuzzyreact-fields-keeperscripts-clineo-bash-lsplomoquick-markdown-editorrich-markdownrafae-rich-markdown-editorrich-markdown-editor-enhancedrich-markdown-editorrich-markdown-editor-customizablerich-markdown-editor-drepatedrich-markdown-editor-pstrich-markdown-editor-v2qy-self-use-editorsnippeteergit-split-branchgitee-guide-helperggfontscerebro-google-chrome-bookmarkschurch-yearchonky-customchonky-custom1.1chonky-navtecachonkychonky-ost-v3
3.2.1

6 years ago

3.2.0

6 years ago

3.1.0

6 years ago

3.0.2

6 years ago

2.2.1

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.5.0

8 years ago

1.4.0

9 years ago

1.3.8

9 years ago

1.3.7

9 years ago

1.3.6

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago