Fork me on GitHub
download zip download tar

string_score by joshaven

JavaScript string ranking... "String".score("str"); //=> 0.825


Try me:
" ".score(" "); //=>

Or play with my fuzziness:
" ".score(" ", ); //=>

Fuzzyness should be between 0 and 1. Low fuzziness like 0.01 means a mismatch will drop the score more then a fuzziness of something like 0.9.


Any modern bower, NodeJS, or other JavaScript interpreter.


If your using node.js then install with NPM and require...

Install with node.js from your terminal.

npm install --save string_score

Require string_score from inside of your app.


If your using string_score inside of a browser

Simply include one of the string score JavaScript files and call the .score() method on any string.

I recommend using string_score.min.js (520 bytes) because it is small. The full file string_score.js (2868 bytes) includes comments and full variable names but is otherwise the same as the minified version.

The string_score file is hosted on and can be included with the following in your page:

<script type="text/javascript" src="//"></script>


View Ports on Github


MIT license:



If you expect that something is not right with this project, please Submit an Issue.

If your having trouble feel free to email me: Joshaven Potter ([email protected])

Download Options

You can use wget to download the current min version (less then a half of a kilobyte)

$ wget

You can use curl to download the current min version (less then a half of a kilobyte)

$ curl -O

If you want to modify the project, you could also clone the whole project with Git by running:

$ git clone git://

You could also download the whole project in either zip or tar formats.