3.2.1 • Published 4 years ago

fuzzy-search v3.2.1

Weekly downloads
54,291
License
ISC
Repository
github
Last release
4 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-browserquick-markdown-editorqy-self-use-editor@routr/ctl@samuelncui/chonky@paragraph-xyz/rich-markdown-editor@raven-crypto/raven-crypto@rolebase/editorrich-markdown-editor-customizablerich-markdown-editor-drepatedrich-markdown-editor-pstrich-markdown-editor-v2rich-markdownrich-markdown-editorsats-ui-lib@snack-uikit/chips@snack-uikit/fields@socialbaking/karma@sirena/earth-commonrafae-rich-markdown-editor@moaazsidat/rich-markdown-editorreact-fields-keeperreact-emoji-popup-lister@mhaz42/chonky@mhaz42/react-chonkyreact-hook-fuzzy@marconunnari/rich-markdown-editor@mariuszbartnik/chonky@nosferatu500/chonky@noted-md/rich-markdown-editor@notea/rich-markdown-editorselektorsnippeteer@thoughtback/rich-markdown-editor@tw-material/file-browserrsharp-cli@pick-chunks/pc@povio/ui-kitsaber-plugin-local-search@pnegahdar/rich-markdown-editorstyllo-markdown-editor@techtrain/rich-markdown-editor@sphinx-immer/op-kits@svenardo/chonky@soroker/chonkyds_chonkyedvoramarkembeddedtradebotfuzzy-emojifuzzy-new-filefkill-clifbranchfc-chonkyflowstate-editorflowstate-editor-tempflowstate-editor-temp-2filemanager-library-ver-eccggfontsgit-split-branchgitee-guide-helpermetro-visualizerlicensekv-custom-chonky@epallinone/chonky@fedotxxl/prose-rich-editor@fedotxxl/rich-markdown-editormarktowngenerator-gitignore-iographql-mock-data-generatorgenerator-springloadedmusic-instrumentshello-world-editorkalamakalama-mplayer@fabriziospadaro/chonkyparatechchonky@first-approval/chonkyopen-in-vscodenuchonkyplomoanue-cli@algoraven/crypto@ampolon/rich-markdown-editor-v2@ananthan-cloud/chonky-file-explorer@aperturerobotics/chonkyvue-pancake-icons@animech-public/chonky@andreyblinov/rich-markdown-editor@archguard/archdoc-editor@ashleyhyper/chonky@asterics-docs/vuepress-theme-docs
3.2.1

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.2

5 years ago

2.2.1

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.2.0

5 years ago

2.1.0

6 years ago

2.0.2

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.8

7 years ago

1.3.7

7 years ago

1.3.6

7 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago