Tiny fuzzy searcher (Under 300 bytes gzipped)
$ npm install fuzzy-finder
# OR
$ yarn add fuzzy-finder
Or with CDN:
<script src="https://unpkg.com/[email protected]/dist/fuzzy-finder.umd.js"></script>
import fuzzyFinder from 'fuzzy-finder'
console.log(fuzzy('da', [
'dota.js',
'stratures.js',
'structures.js',
'database.db',
'user-data.js',
'dummy-data.txt',
'other.js'
]))
// [ { match: 'dota.js', rank: 0 },
// { match: 'database.db', rank: 0 },
// { match: 'user-data.js', rank: 5 },
// { match: 'dummy-data.txt', rank: 0 } ]
Check out the example here.
Contributions are welcome!
- Fork it.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Or open up a issue.
Licensed under the MIT License.