Gathering detailed insights and metrics for fuzzy
Gathering detailed insights and metrics for fuzzy
Gathering detailed insights and metrics for fuzzy
Gathering detailed insights and metrics for fuzzy
npm install fuzzy
99.9
Supply Chain
99.5
Quality
75.3
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
832 Stars
64 Commits
86 Forks
17 Watching
2 Branches
8 Contributors
Updated on 20 Nov 2024
JavaScript (90.59%)
HTML (6.49%)
Makefile (2.92%)
Cumulative downloads
Total Downloads
Last day
-36.4%
335,161
Compared to previous day
Last week
-7.2%
2,460,644
Compared to previous week
Last month
6.6%
10,837,781
Compared to previous month
Last year
62.5%
93,160,955
Compared to previous year
5
1k standalone fuzzy search / fuzzy filter a la Sublime Text's command-p fuzzy file search. Works in both node and browser.
Try it yourself: Disney Character Search Example
Node:
1$ npm install --save fuzzy 2$ node 3> var fuzzy = require('fuzzy'); 4> console.log(fuzzy) 5{ test: [Function], 6 match: [Function], 7 filter: [Function] }
Browser:
1<script src="/path/to/fuzzy.js"></script> 2<script> 3 console.log(fuzzy); 4 // Object > 5 // filter: function (pattern, arr, opts) { 6 // match: function (pattern, string, opts) { 7 // test: function (pattern, string) { 8</script>
Padawan: Simply filter an array of strings.
1var list = ['baconing', 'narwhal', 'a mighty bear canoe']; 2var results = fuzzy.filter('bcn', list) 3var matches = results.map(function(el) { return el.string; }); 4console.log(matches); 5// [ 'baconing', 'a mighty bear canoe' ]
Jedi: Wrap matching characters in each string
1var list = ['baconing', 'narwhal', 'a mighty bear canoe']; 2var options = { pre: '<', post: '>' }; 3var results = fuzzy.filter('bcn', list, options) 4console.log(results); 5// [ 6// {string: '<b>a<c>o<n>ing' , index: 0, score: 3, original: 'baconing'}, 7// {string: 'a mighty <b>ear <c>a<n>oe', index: 2, score: 3, original: 'a mighty bear canoe'} 8// ]
Jedi Master: sometimes the array you give is not an array of strings. You can pass in a function that creates the string to match against from each element in the given array
1var list = [ 2 {rompalu: 'baconing', zibbity: 'simba'} 3 , {rompalu: 'narwhal' , zibbity: 'mufasa'} 4 , {rompalu: 'a mighty bear canoe', zibbity: 'saddam hussein'} 5]; 6var options = { 7 pre: '<' 8 , post: '>' 9 , extract: function(el) { return el.rompalu; } 10}; 11var results = fuzzy.filter('bcn', list, options); 12var matches = results.map(function(el) { return el.string; }); 13console.log(matches); 14// [ '<b>a<c>o<n>ing', 'a mighty <b>ear <c>a<n>oe' ]
Check out the html files in the examples directory.
Try the examples live:
Code is well documented and the unit tests cover all functionality
Fork the repo!
git clone <your_fork>
cd fuzzy
npm install
make
Add unit tests for any new or changed functionality. Lint, test, and minify using make, then shoot me a pull request.
v0.1.0 - July 25, 2012
v0.1.1 - September 19, 2015
v0.1.2 - September 25, 2016
v0.1.3 - October 1, 2016
Copyright (c) 2015 Matt York Licensed under the MIT license.
<b>od<a>ciou<s> ba<s>s
. There is
a test already written, just need to implement it. Naive O(n^2) worst
case: find every match in the string, then select the highest scoring
match. Should benchmark this against current implementation once implemented
Also, "reactive rice" would be <r><e>active r<i><c>e
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 5/20 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More